public interface HotRestartStore
Update operations (put/remove/clear) accept a "needs fsync" parameter which determines the persistence semantics of the operation (immediate vs. eventual). For each given key prefix the value of this parameter must always be the same because the Hot Restart Store will group a batch of operations by the "needs fsync" value. Order within each group is preserved.
| Modifier and Type | Field and Description |
|---|---|
static String |
LOG_CATEGORY
The name of the log category used by the Hot Restart module
|
| Modifier and Type | Method and Description |
|---|---|
void |
backup(File targetDir)
Copies the contents of this hot restart store to the target directory.
|
void |
clear(boolean needsFsync,
long... keyPrefixes)
Removes all mappings for the supplied list of key prefixes.
|
void |
close()
Closes this Hot Restart store and releases any system resources it
had acquired.
|
com.hazelcast.hotrestart.BackupTaskState |
getBackupTaskState()
Returns the state of the hot restart backup task
|
void |
hotRestart(boolean failIfAnyData,
int storeCount,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem>[] keyConveyors,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem> keyHandleConveyor,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem>[] valueConveyors)
Performs hot restart: reads the data from persistent storage and pushes it
to its associated
RamStoreRegistry. |
void |
interruptBackupTask()
Interrupts the backup task if one is currently running.
|
String |
name()
Returns the store's name, which matches the name of its home directory.
|
void |
put(HotRestartKey key,
byte[] value,
boolean needsFsync)
Establishes a persistent mapping from the supplied key to the supplied value.
|
void |
remove(HotRestartKey key,
boolean needsFsync)
Removes the persistent mapping for the supplied key.
|
static final String LOG_CATEGORY
String name()
void hotRestart(boolean failIfAnyData,
int storeCount,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem>[] keyConveyors,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem> keyHandleConveyor,
com.hazelcast.internal.util.concurrent.ConcurrentConveyor<RestartItem>[] valueConveyors)
throws InterruptedException
RamStoreRegistry.failIfAnyData - if true, the call will fail if any persistent data is foundstoreCount - the number of Hot Restart stores associated with the Hazelcast instancekeyConveyors - convey keys from HotRestartStore to RamStorevalueConveyors - convey values from HotRestartStore to RamStorekeyHandleConveyor - conveys key handles from RamStore to HotRestartStoreInterruptedExceptionvoid put(HotRestartKey key, byte[] value, boolean needsFsync) throws HotRestartException
This method must not be called while holding a lock that can block the progress of
RamStore.copyEntry(KeyHandle, int, RecordDataSink) on any
RamStore which can be returned by the RamStoreRegistry
associated with this Hot Restart store.
needsFsync - if true, the currently active chunk will be fsync'd before closing.
If this parameter is false, there is no guarantee that a later call
to #fsync() will make this operation persistent.HotRestartExceptionvoid remove(HotRestartKey key, boolean needsFsync) throws HotRestartException
This method must not be called while holding a lock that can block the progress of
RamStore.copyEntry(KeyHandle, int, RecordDataSink) on any
RamStore which can be returned by the RamStoreRegistry
associated with this Hot Restart store.
needsFsync - if true, the currently active chunk will be fsync'd before closing.
If this parameter is false, there is no guarantee that a later call
to #fsync() will make this operation persistent.HotRestartExceptionvoid clear(boolean needsFsync,
long... keyPrefixes)
throws HotRestartException
This method must not be called while holding a lock that can block the progress of
RamStore.copyEntry(KeyHandle, int, RecordDataSink) on any
RamStore which can be returned by the RamStoreRegistry
associated with this Hot Restart store.
needsFsync - has no effect on the semantics of persistence, but its
value must match the "needs fsync" configuration of all supplied
key prefixeskeyPrefixes - the key prefixes whose data is to be clearedHotRestartExceptionvoid close()
throws HotRestartException
This method must not be called while holding a lock that can block the progress of
RamStore.copyEntry(KeyHandle, int, RecordDataSink) on any
RamStore which can be returned by the RamStoreRegistry
associated with this Hot Restart store.
HotRestartExceptionvoid backup(File targetDir)
targetDir - the directory under which backups for the stores will be createdcom.hazelcast.hotrestart.BackupTaskState getBackupTaskState()
void interruptBackupTask()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.