public interface ClusterParticipant
extends java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Terminate the participant.
|
ReplicaSyncUpManager |
getReplicaSyncUpManager()
Gets the
ReplicaSyncUpManager object. |
java.util.List<java.lang.String> |
getSealedReplicas()
Get a list of replicas that are marked as sealed (read-only).
|
java.util.List<java.lang.String> |
getStoppedReplicas()
Get a list of replicas that are marked as stopped.
|
void |
participate(java.util.List<AmbryHealthReport> ambryHealthReports)
Initiate the participation of cluster participant.
|
void |
registerPartitionStateChangeListener(StateModelListenerType listenerType,
PartitionStateChangeListener partitionStateChangeListener)
Register a listener for leadership changes in partitions of this node.
|
boolean |
setReplicaSealedState(ReplicaId replicaId,
boolean isSealed)
Set or reset the sealed state of the given replica.
|
boolean |
setReplicaStoppedState(java.util.List<ReplicaId> replicaIds,
boolean markStop)
Set or reset the stopped state of the given replica.
|
boolean |
updateDataNodeInfoInCluster(ReplicaId replicaId,
boolean shouldExist)
Update disk/replica infos associated with current data node in cluster (this occurs when replica addition/removal
on current node is complete and local changes will be broadcast to all listeners in this cluster)
|
void participate(java.util.List<AmbryHealthReport> ambryHealthReports) throws java.io.IOException
ambryHealthReports
- List
of AmbryHealthReport
to be registered to the participant.java.io.IOException
boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed)
replicaId
- the ReplicaId
whose sealed state will be updated.isSealed
- if true, the replica will be marked as sealed; otherwise it will be marked as read-write.true
if set replica sealed state was successful. false
if not.boolean setReplicaStoppedState(java.util.List<ReplicaId> replicaIds, boolean markStop)
replicaIds
- a list of replicas whose stopped state will be updatedmarkStop
- if true, the replica will be marked as stopped; otherwise it will be marked as started.true
if set replica stopped state was successful. false
if not.java.util.List<java.lang.String> getSealedReplicas()
java.util.List<java.lang.String> getStoppedReplicas()
void registerPartitionStateChangeListener(StateModelListenerType listenerType, PartitionStateChangeListener partitionStateChangeListener)
listenerType
- the type of listener, which is defined in StateModelListenerType
partitionStateChangeListener
- listener to register.ReplicaSyncUpManager getReplicaSyncUpManager()
ReplicaSyncUpManager
object.ReplicaSyncUpManager
that is used to determine new replica has caught up with peers or peer replicas
have caught up with old replica that is being decommissioned.boolean updateDataNodeInfoInCluster(ReplicaId replicaId, boolean shouldExist)
replicaId
- the ReplicaId
whose info should be updated on current nodeshouldExist
- Whether the replica info should exist or not. When true
, replica info will be added if
it is missing in current node info. When false
, replica info will be removed if present.true
, node info is successfully updated. false
otherwise.void close()
close
in interface java.lang.AutoCloseable