public class DrSenderFsStore extends DrAbstractSenderStore implements LifecycleAware
setDirectoryPath(String)
)setMaxFileSize(long)
)setMaxFilesCount(int)
)setCheckpointFrequency(long)
)setOverflowMode(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 String |
DFLT_GLOBAL_STORE_DIR_NAME
Deprecated.
|
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 String |
DFLT_PARENT_DIR_NAME
Default parent directory name for per-replica stores.
|
static int |
DFLT_READ_BUF_SIZE
Default read buffer size.
|
static boolean |
DFLT_SYNCHRONOUS_MODE
Default synchronous mode flag.
|
overflowMode
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.
|
int |
getReadBufferSize()
Gets read buffer size.
|
boolean |
isChecksumEnabled()
Gets checksum enabled flag.
|
boolean |
isSyncronousWrites()
Gets synchronous mode flag.
|
long |
redoBytesSize(byte dataCenterId) |
DrSenderFsStore |
setCheckpointFrequency(long checkPntFreq)
Sets checkpoint creation frequency.
|
DrSenderFsStore |
setChecksumEnabled(boolean checksum)
Gets checksum enabled flag.
|
DrSenderFsStore |
setDirectoryPath(String dirPath)
Sets directory path where persistent store data is to be saved.
|
DrSenderFsStore |
setMaxFilesCount(int maxFilesNum)
Sets maximum amount of files files which can be used to store data.
|
DrSenderFsStore |
setMaxFileSize(long maxFileSize)
Sets maximum size of each file where data is stored in bytes.
|
DrSenderFsStore |
setOverflowMode(DrSenderStoreOverflowMode overflowMode)
Sets overflow mode defining how store will behave in case of overflow.
|
DrSenderFsStore |
setReadBufferSize(int readBufSize)
Sets read buffer size.
|
DrSenderFsStore |
setSynchronousWrites(boolean syncMode)
Sets synchronous mode flag.
|
long |
sizeBytes() |
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,
@Nullable IgniteUuid fstId)
Add data to store.
|
void |
terminate()
Closes files without flushing checkpoint.
|
String |
toString() |
long |
totalBytes() |
clear, cursor, getOverflowMode, isOverflow, onOverflow, setOverflowCallback, store
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
store
public static final int DFLT_MAX_FILES_CNT
public static final int DFLT_MAX_FILE_SIZE
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 static final String DFLT_PARENT_DIR_NAME
@Deprecated public static final String DFLT_GLOBAL_STORE_DIR_NAME
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 DrSenderFsStore setMaxFileSize(long maxFileSize)
getMaxFileSize()
for more
information.maxFileSize
- Maximum size of each file where data is stored in bytesthis
for chaining.public 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 DrSenderFsStore setMaxFilesCount(int maxFilesNum)
getMaxFilesCount()
for more
information.maxFilesNum
- Maximum amount of files files which can be used to store datathis
for chaining.public boolean isSyncronousWrites()
When set to true
, each call to DrAbstractSenderStore.store(byte[], byte[], int, org.apache.ignite.lang.IgniteUuid)
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 DrSenderFsStore setSynchronousWrites(boolean syncMode)
See isSyncronousWrites()
for more information.
syncMode
- Synchronous mode flag.this
for chaining.public long getCheckpointFrequency()
Defaults to DFLT_CHECKPOINT_FREQ
.
public DrSenderFsStore setCheckpointFrequency(long checkPntFreq)
getCheckpointFrequency()
for more information.checkPntFreq
- Checkpoint creation frequency.this
for chaining.public String getDirectoryPath()
public DrSenderFsStore setDirectoryPath(String dirPath)
getDirectoryPath()
for more
information.dirPath
- Directory path.this
for chaining.public DrSenderFsStore setOverflowMode(DrSenderStoreOverflowMode overflowMode)
DrAbstractSenderStore.getOverflowMode()
for more information.setOverflowMode
in class DrAbstractSenderStore
overflowMode
- Overflow mode.this
for chaining.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 DrSenderFsStore setChecksumEnabled(boolean checksum)
isChecksumEnabled()
for more information.checksum
- Checksum enabled flag.this
for chaining.public int getReadBufferSize()
Default to DFLT_READ_BUF_SIZE
.
public DrSenderFsStore setReadBufferSize(int readBufSize)
getReadBufferSize()
for more information.readBufSize
- Read buffer size.this
for chaining.public void start() throws IgniteException
start
in interface LifecycleAware
IgniteException
- If failed.public long sizeBytes()
sizeBytes
in interface DrSenderStore
public void stop()
stop
in interface LifecycleAware
public void terminate()
For tests only.
public void clear0() throws IgniteCheckedException
clear0
in class DrAbstractSenderStore
IgniteCheckedException
- If failed.public void store0(byte[] dataCenters, byte[] data, int cnt, @Nullable @Nullable IgniteUuid fstId) throws IgniteCheckedException
store0
in class DrAbstractSenderStore
dataCenters
- Data center id.data
- Data to store.cnt
- Entries count.fstId
- Full state transfer id.DrSenderStoreOverflowException
- If store is overflowed and mode is DrSenderStoreOverflowMode.STOP
.IgniteCheckedException
public void deleteOldFiles() throws IgniteCheckedException
IgniteCheckedException
- If failed.public int filesNum()
public DrSenderStoreCursor cursor0(byte dataCenterId) throws IgniteCheckedException
cursor0
in class DrAbstractSenderStore
dataCenterId
- Data center id.IgniteCheckedException
- If fails.public long redoBytesSize(byte dataCenterId) throws IgniteCheckedException
dataCenterId
- Data center ID.-1
if
log is overwhelmed for this data center and full state
transfer required.IgniteCheckedException
- If failed.public long totalBytes()
public long getActiveEntriesCount()
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024