voldemort.client.rebalance
Class RebalancePartitionsInfo

java.lang.Object
  extended by voldemort.client.rebalance.RebalancePartitionsInfo

public class RebalancePartitionsInfo
extends java.lang.Object

Holds the list of partitions being moved / deleted for a stealer-donor node tuple


Constructor Summary
RebalancePartitionsInfo(int stealerNodeId, int donorId, java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToAddPartitionList, java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToDeletePartitionList, Cluster initialCluster, int attempt)
          Rebalance Partitions info maintains all information needed for rebalancing for a stealer-donor node tuple
 
Method Summary
 com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> asMap()
           
static RebalancePartitionsInfo create(java.util.Map<?,?> map)
           
static RebalancePartitionsInfo create(java.lang.String line)
           
 boolean equals(java.lang.Object o)
           
 int getAttempt()
           
 int getDonorId()
           
 Cluster getInitialCluster()
           
 java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> getReplicaToAddPartitionList(java.lang.String storeName)
           
 java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> getReplicaToDeletePartitionList(java.lang.String storeName)
           
 int getStealerId()
           
 java.util.List<java.lang.Integer> getStealMasterPartitions()
          Gives the list of primary partitions being moved across all stores.
 java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> getStoreToReplicaToAddPartitionList()
           
 java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> getStoreToReplicaToDeletePartitionList()
           
 java.util.Set<java.lang.String> getUnbalancedStoreList()
          Returns the stores which have their partitions being added ( The stores with partitions being deleted are a sub-set )
 int hashCode()
           
 void removeStore(java.lang.String storeName)
           
 void setAttempt(int attempt)
           
 void setStoreToReplicaToAddPartitionList(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToAddPartitionList)
           
 void setStoreToReplicaToDeletePartitionList(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToDeletePartitionList)
           
 java.lang.String toJsonString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RebalancePartitionsInfo

public RebalancePartitionsInfo(int stealerNodeId,
                               int donorId,
                               java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToAddPartitionList,
                               java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToDeletePartitionList,
                               Cluster initialCluster,
                               int attempt)
Rebalance Partitions info maintains all information needed for rebalancing for a stealer-donor node tuple

Parameters:
stealerNodeId - Stealer node id
donorId - Donor node id
storeToReplicaToAddPartitionList - Map of store name to map of replica type to partitions to add
storeToReplicaToDeletePartitionList - Map of store name to map of replica type to partitions to delete
initialCluster - We require the state of the current metadata in order to determine correct key movement for RW stores. Otherwise we move keys on the basis of the updated metadata and hell breaks loose.
attempt - Attempt number
Method Detail

create

public static RebalancePartitionsInfo create(java.lang.String line)

create

public static RebalancePartitionsInfo create(java.util.Map<?,?> map)

asMap

public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> asMap()

setAttempt

public void setAttempt(int attempt)

getDonorId

public int getDonorId()

getAttempt

public int getAttempt()

getStealerId

public int getStealerId()

getInitialCluster

public Cluster getInitialCluster()

getUnbalancedStoreList

public java.util.Set<java.lang.String> getUnbalancedStoreList()
Returns the stores which have their partitions being added ( The stores with partitions being deleted are a sub-set )

Returns:
Set of store names

getStoreToReplicaToAddPartitionList

public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> getStoreToReplicaToAddPartitionList()

getStoreToReplicaToDeletePartitionList

public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> getStoreToReplicaToDeletePartitionList()

getReplicaToAddPartitionList

public java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> getReplicaToAddPartitionList(java.lang.String storeName)

getReplicaToDeletePartitionList

public java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> getReplicaToDeletePartitionList(java.lang.String storeName)

setStoreToReplicaToAddPartitionList

public void setStoreToReplicaToAddPartitionList(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToAddPartitionList)

setStoreToReplicaToDeletePartitionList

public void setStoreToReplicaToDeletePartitionList(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> storeToReplicaToDeletePartitionList)

removeStore

public void removeStore(java.lang.String storeName)

getStealMasterPartitions

public java.util.List<java.lang.Integer> getStealMasterPartitions()
Gives the list of primary partitions being moved across all stores.

Returns:
List of primary partitions

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toJsonString

public java.lang.String toJsonString()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu