public class DrSenderFsStore extends DrAbstractSenderStore implements DrSenderStore, org.apache.ignite.lifecycle.LifecycleAware
setDirectoryPath(String))setMaxFileSize(long))setMaxFilesCount(int))setCheckpointFrequency(long))setOverflowMode(org.gridgain.grid.dr.store.DrSenderStoreOverflowMode))setChecksumEnabled(boolean))setReadBufferSize(int))DrSenderStore| 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 DrSenderStoreOverflowMode |
DFLT_OVERFLOW_MODE
Default overflow mode.
|
static int |
DFLT_READ_BUF_SIZE
Default read buffer size.
|
static boolean |
DFLT_SYNCHRONOUS_MODE
Default synchronous mode flag.
|
| Constructor and Description |
|---|
DrSenderFsStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear0()
Clears store.
|
DrSenderStoreCursor |
cursor0(byte dataCenterId)
Create new cursor for specified data center.
|
void |
deleteOldFiles()
Delete old files.
|
int |
filesNum() |
long |
getActiveEntriesCount()
Gets sum of Cursor.active.size() for all Cursors created
for this Store.
|
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.
|
DrSenderStoreOverflowMode |
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.
|
boolean |
isSyncronousWrites()
Gets synchronous mode flag.
|
protected DrSenderStoreOverflowMode |
overflowMode() |
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(DrSenderStoreOverflowMode overflowMode)
Sets overflow mode defining how store will behave in case of overflow.
|
void |
setReadBufferSize(int readBufSize)
Sets read buffer size.
|
void |
setSynchronousWrites(boolean syncMode)
Sets synchronous mode flag.
|
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
void |
store0(byte[] dataCenters,
byte[] data,
int cnt)
Add data to store.
|
void |
terminate()
Closes files without flushing checkpoint.
|
String |
toString() |
long |
totalBytes() |
clear, cursor, isOverflow, onOverflow, storeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, cursor, isOverflow, storepublic static final int DFLT_MAX_FILES_CNT
public static final int DFLT_MAX_FILE_SIZE
public static final DrSenderStoreOverflowMode 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 static final boolean DFLT_SYNCHRONOUS_MODE
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 boolean isSyncronousWrites()
When set to true, each call to DrAbstractSenderStore.store(byte[], byte[], int) method will flush all data to disk and
guarantee consistency even in case of application crash. This gives strong failover protection at the cost
of notable decrease in throughput.
When set to false, write buffers will be flushed according to setCheckpointFrequency(long).
Defaults to DFLT_SYNCHRONOUS_MODE;
public void setSynchronousWrites(boolean syncMode)
See isSyncronousWrites() for more information.
syncMode - Synchronous mode flag.public 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 DrSenderStoreOverflowMode getOverflowMode()
Defaults to DFLT_OVERFLOW_MODE.
public void setOverflowMode(DrSenderStoreOverflowMode overflowMode)
getOverflowMode() for more
information.overflowMode - Overflow mode.protected DrSenderStoreOverflowMode overflowMode()
overflowMode in class DrAbstractSenderStorepublic 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()
start in interface org.apache.ignite.lifecycle.LifecycleAwarepublic void stop()
stop in interface org.apache.ignite.lifecycle.LifecycleAwarepublic void terminate()
For tests only.
public void clear0()
throws org.apache.ignite.IgniteCheckedException
clear0 in class DrAbstractSenderStoreorg.apache.ignite.IgniteCheckedException - If failed.public void store0(byte[] dataCenters,
byte[] data,
int cnt)
throws org.apache.ignite.IgniteCheckedException
store0 in class DrAbstractSenderStoredataCenters - Data center id.data - Data to store.org.apache.ignite.IgniteCheckedExceptionpublic void deleteOldFiles()
throws org.apache.ignite.IgniteCheckedException
org.apache.ignite.IgniteCheckedException - If failed.public int filesNum()
public DrSenderStoreCursor cursor0(byte dataCenterId) throws org.apache.ignite.IgniteCheckedException
cursor0 in class DrAbstractSenderStoredataCenterId - Data center id.org.apache.ignite.IgniteCheckedExceptionpublic long redoBytesSize(byte dataCenterId)
throws org.apache.ignite.IgniteCheckedException
dataCenterId - Data center ID.-1 if
log is overwhelmed for this data center and full state
transfer required.org.apache.ignite.IgniteCheckedException - If failed.public long totalBytes()
public long getActiveEntriesCount()
GridGain Fabric : ver. 7.8.12 Release Date : October 2 2017