Disk Store Configuration Parameters

You define your disk stores in <disk-store> subelements of your cache declaration in cache.xml. All disk stores are available for use by all of your regions and queues.

These <disk-store> attributes and subelements in have corresponding setter and getter methods in the com.gemstone.gemfire.cache.DiskStoreFactory and com.gemstone.gemfire.cache.DiskStore APIs.

Disk Store Configuration Attributes and Elements

disk-store attribute Description Default
name String used to identify this disk store. All regions and queues select their disk store by specifying this name.  
allow-force-compaction Boolean indicating whether to allow manual compaction through the API or command-line tools. false
auto-compact Boolean indicating whether to automatically compact a file when it reaches the compaction-threshold. true
compaction-threshold Percentage of garbage allowed in the file before it is eligible for compaction. Garbage is created by entry destroys, entry updates, and region destroys and creates. Surpassing this percentage does not make compaction occur—it makes the file eligible to be compacted when a compaction is done. 50
max-oplog-size The largest size, in megabytes, to allow an operation log to become before automatically rolling to a new file. This size is the combined sizes of the oplog files. 1024
queue-size For asynchronous queueing. The maximum number of operations to allow into the write queue before automatically flushing the queue. Operations that would add entries to the queue block until the queue is flushed. A value of zero implies no size limit. Reaching this limit or the time-interval limit will cause the queue to flush. 0
time-interval For asynchronous queueing. The number of milliseconds that can elapse before data is flushed to disk. Reaching this limit or the queue-size limit causes the queue to flush. 1000
write-buffer-size Size of the buffer used to write to disk. 32768

disk-store subelement Description Default
<disk-dirs> Defines the system directories where the disk store is written and their maximum sizes. . with no size limit

disk-dirs Element

The <disk-dirs> element defines the host system directories to use for the disk store. It contains one or more single <disk-dir> elements with the following contents:
  • The directory specification, provided as the text of the disk-dir element.
  • An optional dir-size attribute specifying the maximum amount of space, in megabytes, to use for the disk store in the directory. By default, there is no limit. The space used is calculated as the combined sizes of all oplog files.

You can specify any number of disk-dir subelements to the disk-dirs element. The data is spread evenly among the active disk files in the directories, keeping within any limits you set.

Example:
<disk-dirs>
	<disk-dir>/host1/users/gf/memberA_DStore</disk-dir>
	<disk-dir>/host2/users/gf/memberA_DStore</disk-dir> 
	<disk-dir dir-size="20480">/host3/users/gf/memberA_DStore</disk-dir> 
</disk-dirs>
Note: The directories must exist when the disk store is created or the system throws an exception. GemFire does not create directories.

Use different disk-dir specifications for different disk stores. You cannot use the same directory for the same named disk store in two different members.