GemFire 6.5.1.2

com.gemstone.gemfire.cache
Interface DiskStore


public interface DiskStore

Provides disk storage for one or more regions. The regions in the same disk store will share the same disk persistence attributes. A region without a disk store name belongs to the default disk store.

Instances of this interface are created using DiskStoreFactory.create(java.lang.String). So to create a DiskStore named myDiskStore do this:

   new DiskStoreFactory().create("myDiskStore");
 

Existing DiskStore instances can be found using GemFireCache.findDiskStore(String)

Since:
6.5

Method Summary
 void flush()
          Causes any data that is currently in the asynchronous queue to be written to disk.
 boolean forceCompaction()
          Allows a disk compaction to be forced on this disk store.
 void forceRoll()
          Asks the disk store to start writing to a new oplog.
 boolean getAllowForceCompaction()
          Returns true if manual compaction of disk files is allowed on this region.
 boolean getAutoCompact()
          Returns true if the disk files are to be automatically compacted.
 int getCompactionThreshold()
          Returns the threshold at which an oplog will become compactable.
 File[] getDiskDirs()
          Returns the directories to which the region's data are written.
 int[] getDiskDirSizes()
          Returns the sizes of the disk directories in megabytes
 long getMaxOplogSize()
          Get the maximum size in megabytes a single oplog (operation log) file should be
 String getName()
          Get the name of the DiskStore
 int getQueueSize()
          Returns the maximum number of operations that can be asynchronously queued to be written to disk.
 long getTimeInterval()
          Returns the number of milliseconds that can elapse before unwritten data is written to disk.
 int getWriteBufferSize()
          Returns the size of the write buffer that this disk store will use when writing data to disk.
 

Method Detail

getName

String getName()
Get the name of the DiskStore

Returns:
the name of the DiskStore, if null, it's the default DiskStore
See Also:
DiskStoreFactory.create(java.lang.String)

getAutoCompact

boolean getAutoCompact()
Returns true if the disk files are to be automatically compacted.

Returns:
Returns true if the disk files are to be automatically compacted; false if automatic compaction is turned off

getCompactionThreshold

int getCompactionThreshold()
Returns the threshold at which an oplog will become compactable. Until it reaches this threshold the oplog will not be compacted. The threshold is a percentage in the range 0..100.

Returns:
the threshold, as a percentage, at which an oplog is considered compactable.

getAllowForceCompaction

boolean getAllowForceCompaction()
Returns true if manual compaction of disk files is allowed on this region. Manual compaction is done be calling forceCompaction().

Note that calls to forceCompaction() will also be allowed if automatic compaction is enabled.

Returns:
Returns true if manual compaction of disk files is allowed on this region.

getMaxOplogSize

long getMaxOplogSize()
Get the maximum size in megabytes a single oplog (operation log) file should be

Returns:
the maximum size in megabyte the operations log file can be

getTimeInterval

long getTimeInterval()
Returns the number of milliseconds that can elapse before unwritten data is written to disk.

Returns:
Returns the time interval in milliseconds that can elapse between two writes to disk

getWriteBufferSize

int getWriteBufferSize()
Returns the size of the write buffer that this disk store will use when writing data to disk. Larger values may increase performance but will use more memory. The disk store will allocate one direct memory buffer of this size.

Returns:
Returns the size of the write buffer.

getDiskDirs

File[] getDiskDirs()
Returns the directories to which the region's data are written. If multiple directories are used, GemFire will attempt to distribute the data evenly amongst them.


getDiskDirSizes

int[] getDiskDirSizes()
Returns the sizes of the disk directories in megabytes


getQueueSize

int getQueueSize()
Returns the maximum number of operations that can be asynchronously queued to be written to disk. When this limit is reached, it will cause operations to block until they can be put in the queue. If this DiskStore configures synchronous writing, then queueSize is ignored.

Returns:
the maxinum number of entries that can be queued concurrently for asynchronous writting to disk.

flush

void flush()
Causes any data that is currently in the asynchronous queue to be written to disk. Does not return until the flush is complete.

Throws:
DiskAccessException - If problems are encounter while writing to disk

forceRoll

void forceRoll()
Asks the disk store to start writing to a new oplog. The old oplog will be asynchronously compressed if compaction is set to true. The new oplog will be created in the next available directory with free space. If there is no directory with free space available and compaction is set to false, then a DiskAccessException saying that the disk is full will be thrown. If compaction is true then the application will wait for the other oplogs to be compacted and more space to be created.

Throws:
DiskAccessException

forceCompaction

boolean forceCompaction()
Allows a disk compaction to be forced on this disk store. The compaction is done even if automatic compaction is not configured. If the current active oplog has had data written to it and it is compactable then an implicit call to forceRoll() will be made so that the active oplog can be compacted.

This method will block until the compaction completes.

Returns:
true if one or more oplogs were compacted; false indicates that no oplogs were ready to be compacted or that a compaction was already in progress.
See Also:
getAllowForceCompaction()

GemFire 6.5.1.2

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.