Package com.github.ambry.clustermap
Class ReplicaStatusDelegate
- java.lang.Object
-
- com.github.ambry.clustermap.ReplicaStatusDelegate
-
public class ReplicaStatusDelegate extends java.lang.Object
Delegate class allowing BlobStore to set the replica sealed/stopped status
-
-
Constructor Summary
Constructors Constructor Description ReplicaStatusDelegate(ClusterParticipant clusterParticipant)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disableReplica(ReplicaId replicaId)
Disable given replica on current node (this will trigger LEADER -> STANDBY -> INACTIVE transition)void
enableReplica(ReplicaId replicaId)
Enable given replica on current node (this will trigger OFFLINE -> BOOTSTRAP -> STANDBY transition)java.util.List<java.lang.String>
getSealedReplicas()
java.util.List<java.lang.String>
getStoppedReplicas()
boolean
markStopped(java.util.List<ReplicaId> replicaIds)
Sets a list of replicaIds to stopped statusboolean
seal(ReplicaId replicaId)
Sets replicaId to read-only statusboolean
supportsStateChanges()
boolean
unmarkStopped(java.util.List<ReplicaId> replicaIds)
Sets a list of replicaIds to started statusboolean
unseal(ReplicaId replicaId)
Sets replicaId to read-write status
-
-
-
Constructor Detail
-
ReplicaStatusDelegate
public ReplicaStatusDelegate(ClusterParticipant clusterParticipant)
-
-
Method Detail
-
seal
public boolean seal(ReplicaId replicaId)
Sets replicaId to read-only status- Parameters:
replicaId
- theReplicaId
whose status would be set to read-only.- Returns:
true
if replica is successfully sealed.false
if not.
-
unseal
public boolean unseal(ReplicaId replicaId)
Sets replicaId to read-write status- Parameters:
replicaId
- theReplicaId
whose status would be set to read-write.- Returns:
true
if replica is successfully unsealed.false
if not.
-
markStopped
public boolean markStopped(java.util.List<ReplicaId> replicaIds)
Sets a list of replicaIds to stopped status- Parameters:
replicaIds
- a list of replicas whose status would be set to stopped.- Returns:
true
if replica is successfully marked as stopped.false
if not.
-
unmarkStopped
public boolean unmarkStopped(java.util.List<ReplicaId> replicaIds)
Sets a list of replicaIds to started status- Parameters:
replicaIds
- a list of replicas whose status would be set to started.- Returns:
true
if replica is successfully unmarked and becomes started.false
if not.
-
disableReplica
public void disableReplica(ReplicaId replicaId)
Disable given replica on current node (this will trigger LEADER -> STANDBY -> INACTIVE transition)- Parameters:
replicaId
- theReplicaId
to disable
-
enableReplica
public void enableReplica(ReplicaId replicaId)
Enable given replica on current node (this will trigger OFFLINE -> BOOTSTRAP -> STANDBY transition)- Parameters:
replicaId
- theReplicaId
to disable
-
getStoppedReplicas
public java.util.List<java.lang.String> getStoppedReplicas()
- Returns:
- a list of stopped replicas in InstanceConfig of local node.
-
getSealedReplicas
public java.util.List<java.lang.String> getSealedReplicas()
- Returns:
- a list of sealed replicas in InstanceConfig of local node.
-
supportsStateChanges
public boolean supportsStateChanges()
- Returns:
true
if the underlying participant supports dynamic partition state changes.
-
-