public class GridDrSenderHubFsStore extends Object implements GridDrSenderHubStore, GridLifecycleAware
setDirectoryPath(String))setMaxFileSize(long))setMaxFilesCount(int))setCheckpointFrequency(long))setOverflowMode(GridDrSenderHubStoreOverflowMode))setChecksumEnabled(boolean))setReadBufferSize(int))
GridDrSenderHubConfiguration cfg = new GridDrSenderHubConfiguration();
GridDrSenderHubFsStore store = new GridDrSenderHubFsStore();
// Set directory path.
store.setDirectoryPath("/my/directory/path");
// Set file system store for sender hub.
cfg.setStore(store);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfiguration" singleton="true">
...
<property name="drSenderHubConfiguration">
<bean class="org.gridgain.grid.dr.hub.sender.GridDrSenderHubConfiguration">
<property name="store">
<bean class="org.gridgain.grid.dr.hub.sender.store.fs.GridDrSenderHubFsStore">
<property name="directoryPath" value="/my/directory/path"/>
</bean>
</property>
...
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
GridDrSenderHubStore| Modifier and Type | Field and Description |
|---|---|
static long |
DFLT_CHECKPOINT_FREQ
Default checkpoint creation frequency.
|
static boolean |
DFLT_CHECKSUM_ENABLED
Default checksum enabled flag.
|
static int |
DFLT_MAX_FILE_SIZE
Default maximum amount of files which can be used to store data.
|
static int |
DFLT_MAX_FILES_CNT
Default maximum amount of files which can be used to store data.
|
static GridDrSenderHubStoreOverflowMode |
DFLT_OVERFLOW_MODE
Default overflow mode.
|
static int |
DFLT_READ_BUF_SIZE
Default read buffer size.
|
| Constructor and Description |
|---|
GridDrSenderHubFsStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears store.
|
GridDrSenderHubStoreCursor |
cursor(byte dataCenterId)
Gets cursor for the given data center ID.
|
long |
getCheckpointFrequency()
Gets checkpoint creation frequency.
|
String |
getDirectoryPath()
Gets directory path where persistent store data is to be saved.
|
int |
getMaxFilesCount()
Gets maximum amount of files files which can be used to store data.
|
long |
getMaxFileSize()
Gets maximum size of each file where data is stored in bytes.
|
GridDrSenderHubStoreOverflowMode |
getOverflowMode()
Gets overflow mode defining how store will behave in case of overflow.
|
int |
getReadBufferSize()
Gets read buffer size.
|
boolean |
isChecksumEnabled()
Gets checksum enabled flag.
|
long |
redoBytesSize(byte dataCenterId) |
void |
setCheckpointFrequency(long checkPntFreq)
Sets checkpoint creation frequency.
|
void |
setChecksumEnabled(boolean checksum)
Gets checksum enabled flag.
|
void |
setDirectoryPath(String dirPath)
Sets directory path where persistent store data is to be saved.
|
void |
setMaxFilesCount(int maxFilesNum)
Sets maximum amount of files files which can be used to store data.
|
void |
setMaxFileSize(long maxFileSize)
Sets maximum size of each file where data is stored in bytes.
|
void |
setOverflowMode(GridDrSenderHubStoreOverflowMode overflowMode)
Sets overflow mode defining how store will behave in case of overflow.
|
void |
setReadBufferSize(int readBufSize)
Sets read buffer size.
|
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
void |
store(byte[] dataCenters,
byte[] data)
Store data.
|
String |
toString() |
long |
totalBytes() |
public static final int DFLT_MAX_FILES_CNT
public static final int DFLT_MAX_FILE_SIZE
public static final GridDrSenderHubStoreOverflowMode DFLT_OVERFLOW_MODE
public static final int DFLT_READ_BUF_SIZE
public static final long DFLT_CHECKPOINT_FREQ
public static final boolean DFLT_CHECKSUM_ENABLED
public long getMaxFileSize()
getMaxFilesCount() this
parameter defines maximum amount of space which can be given to the store. Once store size is exceeded, the
earliest entries will be overwritten with more recent ones.
Defaults to DFLT_MAX_FILE_SIZE.
public void setMaxFileSize(long maxFileSize)
getMaxFileSize() for more
information.maxFileSize - Maximum size of each file where data is stored in bytespublic int getMaxFilesCount()
getMaxFileSize() this
parameter defines maximum amount of space which can be given to the store. Once store size is exceeded, the
earliest entries will be overwritten with more recent ones.
Defaults to DFLT_MAX_FILES_CNT.
public void setMaxFilesCount(int maxFilesNum)
getMaxFilesCount() for more
information.maxFilesNum - Maximum amount of files files which can be used to store datapublic long getCheckpointFrequency()
Defaults to DFLT_CHECKPOINT_FREQ.
public void setCheckpointFrequency(long checkPntFreq)
getCheckpointFrequency() for more information.checkPntFreq - Checkpoint creation frequency.public String getDirectoryPath()
public void setDirectoryPath(String dirPath)
getDirectoryPath() for more
information.dirPath - Directory path.public GridDrSenderHubStoreOverflowMode getOverflowMode()
Defaults to DFLT_OVERFLOW_MODE.
public void setOverflowMode(GridDrSenderHubStoreOverflowMode overflowMode)
getOverflowMode() for more
information.overflowMode - Overflow mode.public boolean isChecksumEnabled()
true checksum for store data will be calculated so that
it will be possible to detect data corruption. When set to false checksum will not be calculated and
persisted data corruption or unintended change may be left unnoticed.
Defaults to DFLT_CHECKSUM_ENABLED.
public void setChecksumEnabled(boolean checksum)
isChecksumEnabled() for more information.checksum - Checksum enabled flag.public int getReadBufferSize()
Default to DFLT_READ_BUF_SIZE.
public void setReadBufferSize(int readBufSize)
getReadBufferSize() for more information.readBufSize - Read buffer size.public void start()
throws GridException
start in interface GridLifecycleAwareGridException - If failed.public void stop()
stop in interface GridLifecycleAwarepublic void clear()
throws GridException
GridException - If failed.public void store(byte[] dataCenters,
byte[] data)
throws GridException
store in interface GridDrSenderHubStoredataCenters - Target data center ids.data - Data center replication store entry.GridException - In case of failure.GridDrSenderHubStoreOverflowException - If overflowed.public GridDrSenderHubStoreCursor cursor(byte dataCenterId) throws GridException
cursor in interface GridDrSenderHubStoredataCenterId - Data center ID.GridException - If failed.public long redoBytesSize(byte dataCenterId)
throws GridException
dataCenterId - Data center ID.-1 if
log is overwhelmed for this data center and full state
transfer required.GridException - If failed.public long totalBytes()
Copyright © 2014. All rights reserved.