|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.utils.UpdateClusterUtils
public class UpdateClusterUtils
UpdateClusterUtils provides helper methods for manipulating nodes and clusters. The methods are used by rebalancing tools and in tests.
Constructor Summary | |
---|---|
UpdateClusterUtils()
|
Method Summary | |
---|---|
static Node |
addPartitionsToNode(Node node,
java.util.Set<java.lang.Integer> donatedPartitions)
Add the set of partitions to the node provided |
static Node |
addPartitionToNode(Node node,
java.lang.Integer donatedPartition)
Add a partition to the node provided |
static Cluster |
createUpdatedCluster(Cluster currentCluster,
int stealerNodeId,
java.util.List<java.lang.Integer> donatedPartitions)
Updates the existing cluster such that we remove partitions mentioned from the stealer node and add them to the donor node |
static Node |
removePartitionFromNode(Node node,
java.lang.Integer donatedPartition)
Remove a partition from the node provided |
static Node |
removePartitionsFromNode(Node node,
java.util.Set<java.lang.Integer> donatedPartitions)
Remove the set of partitions from the node provided |
static Cluster |
updateCluster(Cluster currentCluster,
java.util.List<Node> updatedNodeList)
Concatenates the list of current nodes in the given cluster with the new nodes provided and returns an updated cluster metadata. |
static Node |
updateNode(Node node,
java.util.List<java.lang.Integer> partitionsList)
Creates a replica of the node with the new partitions list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UpdateClusterUtils()
Method Detail |
---|
public static Node updateNode(Node node, java.util.List<java.lang.Integer> partitionsList)
node
- The node whose replica we are creatingpartitionsList
- The new partitions list
public static Node addPartitionToNode(Node node, java.lang.Integer donatedPartition)
node
- The node to which we'll add the partitiondonatedPartition
- The partition to add
public static Node removePartitionFromNode(Node node, java.lang.Integer donatedPartition)
node
- The node from which we're removing the partitiondonatedPartition
- The partitions to remove
public static Node addPartitionsToNode(Node node, java.util.Set<java.lang.Integer> donatedPartitions)
node
- The node to which we'll add the partitionsdonatedPartitions
- The list of partitions to add
public static Node removePartitionsFromNode(Node node, java.util.Set<java.lang.Integer> donatedPartitions)
node
- The node from which we're removing the partitionsdonatedPartitions
- The list of partitions to remove
public static Cluster updateCluster(Cluster currentCluster, java.util.List<Node> updatedNodeList)
currentCluster
- The current cluster metadataupdatedNodeList
- The list of new nodes to be added
public static Cluster createUpdatedCluster(Cluster currentCluster, int stealerNodeId, java.util.List<java.lang.Integer> donatedPartitions)
currentCluster
- Existing cluster metadata. Both stealer and donor
node should already exist in this metadatastealerNodeId
- Id of node for which we are stealing the partitionsdonatedPartitions
- List of partitions we are moving
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |