public class ClusterMetadataManager extends Object
| Constructor and Description |
|---|
ClusterMetadataManager(com.hazelcast.instance.Node node,
File hotRestartHome,
com.hazelcast.config.HotRestartPersistenceConfig cfg) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClusterHotRestartEventListener(ClusterHotRestartEventListener listener) |
void |
backup(File targetDir)
Copies the contents of the persisted cluster metadata to a folder with the name
DIR_NAME under the
targetDir. |
void |
forceStartCompleted() |
Set<String> |
getExcludedMemberUuids() |
HotRestartClusterStartStatus |
getHotRestartStatus() |
boolean |
handleForceStartRequest() |
boolean |
handlePartialStartRequest() |
boolean |
isStartCompleted() |
boolean |
isStartWithHotRestart() |
static boolean |
isValidHotRestartDir(File homeDir)
Returns true
cluster directory exists inside the homeDir
and cluster metadata files exist in cluster directory,
false otherwise. |
void |
loadCompletedLocal(Throwable failure) |
void |
onClusterStateChange(com.hazelcast.cluster.ClusterState newState) |
void |
onClusterVersionChange(com.hazelcast.version.Version newClusterVersion) |
void |
onMembershipChange() |
void |
onPartitionStateChange() |
void |
prepare()
Prepares the cluster metadata manager for
start() by loading the existing data from disk. |
String |
readMemberUuid() |
int |
readPartitionThreadCount() |
void |
receiveHotRestartStatus(com.hazelcast.nio.Address sender,
HotRestartClusterStartStatus result,
Set<String> excludedMemberUuids,
com.hazelcast.cluster.ClusterState clusterState) |
void |
reset(boolean isAfterJoin) |
void |
shutdown() |
void |
start()
Starts the metadata manager.
|
void |
stopPersistence() |
void |
writePartitionThreadCount(int count) |
public ClusterMetadataManager(com.hazelcast.instance.Node node,
File hotRestartHome,
com.hazelcast.config.HotRestartPersistenceConfig cfg)
public void prepare()
start() by loading the existing data from disk.
PASSIVE and prepares the list of members removed
in not active state for validating member joinsClusterHotRestartEventListeners that the prepare is completecom.hazelcast.spi.hotrestart.HotRestartException - if there was an IOException while preparing the metadatapublic int readPartitionThreadCount()
public void writePartitionThreadCount(int count)
public boolean isStartWithHotRestart()
public void addClusterHotRestartEventListener(ClusterHotRestartEventListener listener)
public void start()
ClusterHotRestartEventListeners for data load startForceStartException - if not all members joined but force start was requestedcom.hazelcast.spi.hotrestart.HotRestartException - if there were any other errors while startingpublic void loadCompletedLocal(Throwable failure) throws InterruptedException
InterruptedExceptionpublic void forceStartCompleted()
public boolean isStartCompleted()
public void onMembershipChange()
public void onPartitionStateChange()
public void onClusterStateChange(com.hazelcast.cluster.ClusterState newState)
public HotRestartClusterStartStatus getHotRestartStatus()
public void onClusterVersionChange(com.hazelcast.version.Version newClusterVersion)
public boolean handleForceStartRequest()
public boolean handlePartialStartRequest()
public void stopPersistence()
public void reset(boolean isAfterJoin)
public void shutdown()
public void receiveHotRestartStatus(com.hazelcast.nio.Address sender,
HotRestartClusterStartStatus result,
Set<String> excludedMemberUuids,
com.hazelcast.cluster.ClusterState clusterState)
public void backup(File targetDir)
DIR_NAME under the
targetDir. This method does not synchronize with the rest of the code so for consistent metadata it is
necessary to ensure that no cluster metadata changes are in progress during the duration of backup (e.g. no replica
or partition table changes).targetDir - the directory under which the folder with the metadata will be copiedpublic String readMemberUuid()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.