public final class ConcurrentHotRestartStore extends Object implements HotRestartStore
HotRestartStore which delegates work to a
single-threaded HotRestartPersistenceEngine over a many-to-one concurrent queue.| Modifier and Type | Field and Description |
|---|---|
static int |
MUTATOR_QUEUE_CAPACITY
Capacity of the many-to-one queue used by partition threads to submit to HotRestart persistence thread
|
LOG_CATEGORY| 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
|
DiContainer |
getDi()
Gives access to the internal DI container, exclusively for testing purposes.
|
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.
|
public static final int MUTATOR_QUEUE_CAPACITY
public 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
HotRestartStoreRamStoreRegistry.hotRestart in interface HotRestartStorefailIfAnyData - 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 RamStorekeyHandleConveyor - conveys key handles from RamStore to HotRestartStorevalueConveyors - convey values from HotRestartStore to RamStoreInterruptedExceptionpublic void put(HotRestartKey key, byte[] value, boolean needsFsync)
HotRestartStore
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.
put in interface HotRestartStoreneedsFsync - 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.public void remove(HotRestartKey key, boolean needsFsync)
HotRestartStore
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.
remove in interface HotRestartStoreneedsFsync - 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.public void clear(boolean needsFsync,
long... keyPrefixes)
throws HotRestartException
HotRestartStore
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.
clear in interface HotRestartStoreneedsFsync - 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 clearedHotRestartExceptionpublic void close()
throws HotRestartException
HotRestartStore
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.
close in interface HotRestartStoreHotRestartExceptionpublic void backup(File targetDir)
HotRestartStorebackup in interface HotRestartStoretargetDir - the directory under which backups for the stores will be createdpublic com.hazelcast.hotrestart.BackupTaskState getBackupTaskState()
HotRestartStoregetBackupTaskState in interface HotRestartStorepublic void interruptBackupTask()
HotRestartStoreinterruptBackupTask in interface HotRestartStorepublic String name()
HotRestartStorename in interface HotRestartStorepublic DiContainer getDi()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.