12.2.3. File Cache Store Configuration (Library Mode)

In JBoss Data Grid's Library mode, configure a File Cache Store within the loaders element as follows:
<loaders>
    ...
	<fileStore location="${java.io.tmpdir}"
                   streamBufferSize="${SIZE}"
                   fsyncMode="${DEFAULT/PER_WRITE/PERIODIC}"
                   fsyncInterval="${TIME}" />
    ...
</loaders>
The fileStore element is used to configure the File Cache Store with the following parameters:
  • The location parameter provides a location on the disk where the file store can write internal files. The default value for this parameter is the Infinispan-Filestore directory in the working directory.
  • The streamBufferSize parameter sets the size of the buffered stream used to write the state to the disk. Larger buffer sizes result in faster performance but occupy more temporary memory. The default value for this parameter is 8192 bytes.
  • The fsyncMode parameter sets how the file changes synchronize with the underlying file system. Valid values for this parameter are DEFAULT (synchronize when the operating system buffer is full or when the bucket is read), PER_WRITE (synchronize after each write request) and PERIODIC (synchronizes after a defined interval or just before a bucket is read).
  • The fsyncInterval parameter specifies the time period after which the file changes in the cache are flushed. This parameter is used only when the periodic fsync mode is in use. The default value for this parameter is 1 second.