Package com.github.ambry.cloud
Class HelixVcrCluster
- java.lang.Object
-
- com.github.ambry.cloud.HelixVcrCluster
-
- All Implemented Interfaces:
com.github.ambry.clustermap.VirtualReplicatorCluster
,java.lang.AutoCloseable
public class HelixVcrCluster extends java.lang.Object implements com.github.ambry.clustermap.VirtualReplicatorCluster
Helix Based VCR Cluster.
-
-
Constructor Summary
Constructors Constructor Description HelixVcrCluster(com.github.ambry.config.CloudConfig cloudConfig, com.github.ambry.config.ClusterMapConfig clusterMapConfig, com.github.ambry.config.StoreConfig storeConfig, com.github.ambry.clustermap.ClusterMap clusterMap, com.github.ambry.account.AccountService accountService, CloudDestination cloudDestination)
Construct the helix VCR cluster.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(com.github.ambry.clustermap.VirtualReplicatorClusterListener listener)
void
addPartition(java.lang.String partitionIdStr)
AddPartitionId
to assignedPartitionIds set, if {@param partitionIdStr} valid.void
close()
java.util.List<? extends com.github.ambry.clustermap.DataNodeId>
getAllDataNodeIds()
java.util.List<? extends com.github.ambry.clustermap.PartitionId>
getAssignedPartitionIds()
com.github.ambry.clustermap.DataNodeId
getCurrentDataNodeId()
void
participate()
void
removePartition(java.lang.String partitionIdStr)
RemovePartitionId
from assignedPartitionIds set, if {@param partitionIdStr} valid.
-
-
-
Constructor Detail
-
HelixVcrCluster
public HelixVcrCluster(com.github.ambry.config.CloudConfig cloudConfig, com.github.ambry.config.ClusterMapConfig clusterMapConfig, com.github.ambry.config.StoreConfig storeConfig, com.github.ambry.clustermap.ClusterMap clusterMap, com.github.ambry.account.AccountService accountService, CloudDestination cloudDestination)
Construct the helix VCR cluster.- Parameters:
cloudConfig
- The cloud configuration to use.clusterMapConfig
- The clusterMap configuration to use.clusterMap
- The clusterMap to use.
-
-
Method Detail
-
addPartition
public void addPartition(java.lang.String partitionIdStr)
AddPartitionId
to assignedPartitionIds set, if {@param partitionIdStr} valid. Used in one of the vcr state model classesOnlineOfflineHelixVcrStateModel
orLeaderStandbyHelixVcrStateModel
if current VCR is assigned a partition.- Parameters:
partitionIdStr
- The partitionIdStr notified by Helix.
-
removePartition
public void removePartition(java.lang.String partitionIdStr)
RemovePartitionId
from assignedPartitionIds set, if {@param partitionIdStr} valid. Used in one of the vcr state model classesOnlineOfflineHelixVcrStateModel
orLeaderStandbyHelixVcrStateModel
if current VCR becomes offline for a partition.- Parameters:
partitionIdStr
- The partitionIdStr notified by Helix.
-
getAllDataNodeIds
public java.util.List<? extends com.github.ambry.clustermap.DataNodeId> getAllDataNodeIds()
- Specified by:
getAllDataNodeIds
in interfacecom.github.ambry.clustermap.VirtualReplicatorCluster
-
getCurrentDataNodeId
public com.github.ambry.clustermap.DataNodeId getCurrentDataNodeId()
- Specified by:
getCurrentDataNodeId
in interfacecom.github.ambry.clustermap.VirtualReplicatorCluster
-
participate
public void participate() throws java.lang.Exception
- Specified by:
participate
in interfacecom.github.ambry.clustermap.VirtualReplicatorCluster
- Throws:
java.lang.Exception
-
getAssignedPartitionIds
public java.util.List<? extends com.github.ambry.clustermap.PartitionId> getAssignedPartitionIds()
- Specified by:
getAssignedPartitionIds
in interfacecom.github.ambry.clustermap.VirtualReplicatorCluster
-
addListener
public void addListener(com.github.ambry.clustermap.VirtualReplicatorClusterListener listener)
- Specified by:
addListener
in interfacecom.github.ambry.clustermap.VirtualReplicatorCluster
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-