Package com.github.ambry.clustermap
Interface VirtualReplicatorCluster
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface VirtualReplicatorCluster extends java.lang.AutoCloseable
TheVirtualReplicatorCluster
provides a high-level interface to Virtual Replicator Cluster. In Virtual Replicator Cluster,PartitionId
s are resources and they are assigned to participant node.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(VirtualReplicatorClusterListener listener)
AddVirtualReplicatorClusterListener
to listen for cluster change.java.util.List<? extends DataNodeId>
getAllDataNodeIds()
Gets all nodes in the cluster.java.util.Collection<? extends PartitionId>
getAssignedPartitionIds()
Gets allPartitionId
s assigned to current node.DataNodeId
getCurrentDataNodeId()
GetsDataNodeId
representation of current node.boolean
isPartitionAssigned(java.lang.String partitionPath)
Check is a partition is assigned to current node.void
participate()
Join the cluster as a participant.
-
-
-
Method Detail
-
getAllDataNodeIds
java.util.List<? extends DataNodeId> getAllDataNodeIds()
Gets all nodes in the cluster.- Returns:
- list of PartitionId
-
getCurrentDataNodeId
DataNodeId getCurrentDataNodeId()
GetsDataNodeId
representation of current node.- Returns:
- DataNodeId.
-
participate
void participate() throws java.lang.Exception
Join the cluster as a participant.- Throws:
java.lang.Exception
-
getAssignedPartitionIds
java.util.Collection<? extends PartitionId> getAssignedPartitionIds()
Gets allPartitionId
s assigned to current node.- Returns:
Collection
of PartitionId
-
isPartitionAssigned
boolean isPartitionAssigned(java.lang.String partitionPath)
Check is a partition is assigned to current node.- Parameters:
partitionPath
- partition id of the partition.- Returns:
true
if partition is assigned to current node.false
otherwise.
-
addListener
void addListener(VirtualReplicatorClusterListener listener)
AddVirtualReplicatorClusterListener
to listen for cluster change.- Parameters:
listener
- to add.
-
-