public class

IdealStateCalculatorByRush

extends Object
java.lang.Object
   ↳ org.apache.helix.tools.IdealStateCalculatorByRush

Summary

Public Constructors
IdealStateCalculatorByRush()
Public Methods
static ZNRecord calculateIdealState(List<List<String>> instanceClusters, List<Integer> instanceClusterWeights, int partitions, int replicas, String resourceName)
Calculate the ideal state for list of instances clusters.
static ZNRecord calculateIdealState(List<String> instanceClusters, int instanceClusterWeight, int partitions, int replicas, String resourceName)
static void main(String[] args)
static void printDiff(ZNRecord record1, ZNRecord record2)
Helper function to see how many partitions are mapped to different instances in two ideal states
static void printIdealStateStats(ZNRecord record)
Helper function to calculate and print the standard deviation of the partition assignment ideal state.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IdealStateCalculatorByRush ()

Public Methods

public static ZNRecord calculateIdealState (List<List<String>> instanceClusters, List<Integer> instanceClusterWeights, int partitions, int replicas, String resourceName)

Calculate the ideal state for list of instances clusters.

Parameters
instanceClusters List of clusters, each contain a list of node name strings.
instanceClusterWeights the weight for each instance cluster
partitions the partition number of the database
replicas the replication degree
resourceName the name of the database
Returns
  • The ZNRecord that contains the ideal state
Throws
Exception

public static ZNRecord calculateIdealState (List<String> instanceClusters, int instanceClusterWeight, int partitions, int replicas, String resourceName)

Throws
Exception

public static void main (String[] args)

Throws
Exception

public static void printDiff (ZNRecord record1, ZNRecord record2)

Helper function to see how many partitions are mapped to different instances in two ideal states

public static void printIdealStateStats (ZNRecord record)

Helper function to calculate and print the standard deviation of the partition assignment ideal state.