voldemort.client.rebalance
Class RebalanceTaskInfo

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

public class RebalanceTaskInfo
extends java.lang.Object

Rebalance Task info maintains all information needed for rebalancing for a stealer-donor node tuple.


Constructor Summary
RebalanceTaskInfo(int stealerNodeId, int donorId, java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> storeToPartitionIds, Cluster initialCluster)
           
 
Method Summary
 com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> asMap()
           
static RebalanceTaskInfo create(java.util.Map<?,?> map)
           
static RebalanceTaskInfo create(java.lang.String line)
           
 boolean equals(java.lang.Object o)
           
 int getDonorId()
           
 Cluster getInitialCluster()
           
 java.util.List<java.lang.Integer> getPartitionIds(java.lang.String storeName)
          Returns the list of partitions ids corresponding to a store.
 int getPartitionStoreCount()
          Returns the total count of partitions across all stores.
 int getPartitionStoreMoves()
          Total count of partition-stores moved in this task.
 java.util.Set<java.lang.String> getPartitionStores()
          Returns all the store names from the map
 int getStealerId()
           
 java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> getStoreToPartitionIds()
           
 int hashCode()
           
 void removeStore(java.lang.String storeName)
          Removes the store name from the map.
 void setPartitionIds(java.lang.String storeName, java.util.List<java.lang.Integer> partitionIds)
           
 void setStoreToPartitionList(java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> storeToPartitionIds)
           
static java.lang.String taskListToString(java.util.List<RebalanceTaskInfo> infos)
          Pretty prints a task list of rebalancing tasks.
 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

RebalanceTaskInfo

public RebalanceTaskInfo(int stealerNodeId,
                         int donorId,
                         java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> storeToPartitionIds,
                         Cluster initialCluster)
Method Detail

create

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

create

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

asMap

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

getStoreToPartitionIds

public java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> getStoreToPartitionIds()
Returns:
store to partition ids map

setPartitionIds

public void setPartitionIds(java.lang.String storeName,
                            java.util.List<java.lang.Integer> partitionIds)

setStoreToPartitionList

public void setStoreToPartitionList(java.util.HashMap<java.lang.String,java.util.List<java.lang.Integer>> storeToPartitionIds)

getInitialCluster

public Cluster getInitialCluster()
Returns:
initial cluster

getDonorId

public int getDonorId()
Returns:
returns donor node id

getStealerId

public int getStealerId()
Returns:
returns stealer node id

getPartitionStoreMoves

public int getPartitionStoreMoves()
Total count of partition-stores moved in this task.

Returns:
number of partition stores moved in this task.

removeStore

public void removeStore(java.lang.String storeName)
Removes the store name from the map.

Parameters:
storeName - name to be removed from the map

getPartitionIds

public java.util.List<java.lang.Integer> getPartitionIds(java.lang.String storeName)
Returns the list of partitions ids corresponding to a store.

Parameters:
storeName - name of the store
Returns:
list of partitions ids for the store.

getPartitionStores

public java.util.Set<java.lang.String> getPartitionStores()
Returns all the store names from the map

Returns:
returns a list of stores in the map

getPartitionStoreCount

public int getPartitionStoreCount()
Returns the total count of partitions across all stores.

Returns:
returns the total count of partitions across all stores.

toString

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

taskListToString

public static java.lang.String taskListToString(java.util.List<RebalanceTaskInfo> infos)
Pretty prints a task list of rebalancing tasks.

Parameters:
infos - list of rebalancing tasks (RebalancePartitiosnInfo)
Returns:
pretty-printed string

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