public class HotRestartIntegrationService extends Object implements com.hazelcast.spi.hotrestart.RamStoreRegistry, com.hazelcast.hotrestart.InternalHotRestartService
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_NAME
Name of the Hot Restart service.
|
| Constructor and Description |
|---|
HotRestartIntegrationService(com.hazelcast.instance.Node node) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClusterHotRestartEventListener(ClusterHotRestartEventListener listener) |
boolean |
backup(long sequence)
Creates a snapshot (backup) of the current state of the Hot Restart Store to a directory nested under the configured
HotRestartPersistenceConfig.getBackupDir() with the name backup-sequence. |
void |
ensureHasConfiguration(String serviceName,
String name,
Object config)
Ensures that the configuration exists for the given service name and distributed object name.
|
void |
forceStartBeforeJoin() |
File |
getBackupDir(long sequence)
Returns the member specific backup directory for requested backup sequence
|
String |
getCacheName(long prefix)
Returns the distributed object name for the given
RamStoreRegistry prefix. |
ClusterMetadataManager |
getClusterMetadataManager() |
com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO |
getCurrentClusterHotRestartStatus() |
Set<String> |
getExcludedMemberUuids() |
File |
getHotRestartHome() |
com.hazelcast.spi.hotrestart.HotRestartStore |
getOffHeapHotRestartStoreForPartition(int partitionId) |
com.hazelcast.spi.hotrestart.HotRestartStore |
getOnHeapHotRestartStoreForPartition(int partitionId) |
void |
handleExcludedMemberUuids(com.hazelcast.nio.Address sender,
Set<String> excludedMemberUuids) |
boolean |
isBackupInProgress()
Returns true if there is a backup task currently in progress
|
boolean |
isEnabled() |
boolean |
isMemberExcluded(com.hazelcast.nio.Address memberAddress,
String memberUuid) |
boolean |
isStartCompleted() |
void |
notifyExcludedMember(com.hazelcast.nio.Address memberAddress) |
void |
onInitialClusterState(com.hazelcast.cluster.ClusterState initialState) |
int |
prefixToThreadId(long prefix) |
void |
prepare()
Prepares the Hot restart store for
start(). |
com.hazelcast.spi.hotrestart.RamStore |
ramStoreForPrefix(long prefix) |
void |
registerLoadedConfigurationListener(LoadedConfigurationListener listener) |
long |
registerRamStore(com.hazelcast.spi.hotrestart.RamStoreRegistry ramStoreRegistry,
String serviceName,
String name,
int partitionId)
Registers a
RamStoreRegistry. |
void |
registerRamStoreRegistry(String serviceName,
com.hazelcast.spi.hotrestart.RamStoreRegistry registry) |
void |
resetService(boolean isAfterJoin) |
com.hazelcast.spi.hotrestart.RamStore |
restartingRamStoreForPrefix(long prefix) |
void |
shutdown() |
void |
start()
Starts the Hot restart service.
|
boolean |
triggerForceStart() |
boolean |
triggerPartialStart() |
void |
waitPartitionReplicaSyncOnCluster(long timeout,
TimeUnit unit) |
public static final String SERVICE_NAME
public HotRestartIntegrationService(com.hazelcast.instance.Node node)
public boolean isEnabled()
isEnabled in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void registerLoadedConfigurationListener(LoadedConfigurationListener listener)
public com.hazelcast.spi.hotrestart.RamStore ramStoreForPrefix(long prefix)
ramStoreForPrefix in interface com.hazelcast.spi.hotrestart.RamStoreRegistrypublic com.hazelcast.spi.hotrestart.RamStore restartingRamStoreForPrefix(long prefix)
restartingRamStoreForPrefix in interface com.hazelcast.spi.hotrestart.RamStoreRegistrypublic int prefixToThreadId(long prefix)
prefixToThreadId in interface com.hazelcast.spi.hotrestart.RamStoreRegistrypublic com.hazelcast.spi.hotrestart.HotRestartStore getOnHeapHotRestartStoreForPartition(int partitionId)
public com.hazelcast.spi.hotrestart.HotRestartStore getOffHeapHotRestartStoreForPartition(int partitionId)
public long registerRamStore(com.hazelcast.spi.hotrestart.RamStoreRegistry ramStoreRegistry,
String serviceName,
String name,
int partitionId)
RamStoreRegistry. There should already be a configuration for the service and distributed object name.
This can be ensured by calling ensureHasConfiguration(String, String, Object).ramStoreRegistry - the registry to be registeredserviceName - the service namename - the distributed object namepartitionId - the partition IDpublic void registerRamStoreRegistry(String serviceName, com.hazelcast.spi.hotrestart.RamStoreRegistry registry)
public void ensureHasConfiguration(String serviceName, String name, Object config)
serviceName - the service namename - the distributed object nameconfig - the configurationpublic String getCacheName(long prefix)
RamStoreRegistry prefix.prefix - the prefix of the RamStoreRegistryIllegalArgumentException - if there is no descriptor found for this prefixpublic void addClusterHotRestartEventListener(ClusterHotRestartEventListener listener)
public ClusterMetadataManager getClusterMetadataManager()
public void prepare()
start().
public void start()
HotRestartException - if there was any exception while starting the servicepublic boolean backup(long sequence)
HotRestartPersistenceConfig.getBackupDir() with the name backup-sequence. The backup will contain all
data managed by the Hot Restart service, including persistent cache descriptors, cluster metadata and partition data.
The completeness and consistency of the copied data is guaranteed if the cluster is in the ClusterState.PASSIVE
state but can be called in any cluster state. If being called while the cluster is in the ClusterState.ACTIVE
state, the user must make certain that no new persistent cache structures are being created or that there are no cluster
metadata changes, such as:
sequence - the backup sequence. This will determine the directory name for the backuppublic File getBackupDir(long sequence)
sequence - backup sequencepublic boolean isBackupInProgress()
public boolean isStartCompleted()
public boolean triggerForceStart()
triggerForceStart in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic boolean triggerPartialStart()
triggerPartialStart in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void shutdown()
public void forceStartBeforeJoin()
forceStartBeforeJoin in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void resetService(boolean isAfterJoin)
resetService in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic boolean isMemberExcluded(com.hazelcast.nio.Address memberAddress,
String memberUuid)
isMemberExcluded in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic Set<String> getExcludedMemberUuids()
getExcludedMemberUuids in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void onInitialClusterState(com.hazelcast.cluster.ClusterState initialState)
public void notifyExcludedMember(com.hazelcast.nio.Address memberAddress)
notifyExcludedMember in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void handleExcludedMemberUuids(com.hazelcast.nio.Address sender,
Set<String> excludedMemberUuids)
handleExcludedMemberUuids in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO getCurrentClusterHotRestartStatus()
getCurrentClusterHotRestartStatus in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic void waitPartitionReplicaSyncOnCluster(long timeout,
TimeUnit unit)
waitPartitionReplicaSyncOnCluster in interface com.hazelcast.hotrestart.InternalHotRestartServicepublic File getHotRestartHome()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.