From 3122693146f88bab0924306e98fafd5dc0f67ced Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Thu, 30 May 2013 15:41:44 -0700 Subject: [PATCH] Add comments to the tools --- src/java/voldemort/tools/PartitionAnalysisCLI.java | 5 +++++ .../voldemort/tools/RebalanceControllerCLI.java | 4 ++++ src/java/voldemort/tools/RebalancePlanCLI.java | 11 +++++++++-- src/java/voldemort/tools/RepartitionerCLI.java | 13 +++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/java/voldemort/tools/PartitionAnalysisCLI.java b/src/java/voldemort/tools/PartitionAnalysisCLI.java index ba1b2e89ab..8354d646a4 100644 --- a/src/java/voldemort/tools/PartitionAnalysisCLI.java +++ b/src/java/voldemort/tools/PartitionAnalysisCLI.java @@ -36,6 +36,11 @@ import com.google.common.base.Joiner; +/* + * Analyzes the partition layout of a cluster based on the storage definitions + * for that cluster and determines how well balanced the partition layout is. + */ + public class PartitionAnalysisCLI { private final static Logger logger = Logger.getLogger(PartitionAnalysisCLI.class); diff --git a/src/java/voldemort/tools/RebalanceControllerCLI.java b/src/java/voldemort/tools/RebalanceControllerCLI.java index 0ae8661d6d..c06fff2d7e 100644 --- a/src/java/voldemort/tools/RebalanceControllerCLI.java +++ b/src/java/voldemort/tools/RebalanceControllerCLI.java @@ -39,6 +39,10 @@ import com.google.common.base.Joiner; +/* + * Executes the actual rebalance operation againt a server. + */ + public class RebalanceControllerCLI { private final static Logger logger = Logger.getLogger(RebalanceControllerCLI.class); diff --git a/src/java/voldemort/tools/RebalancePlanCLI.java b/src/java/voldemort/tools/RebalancePlanCLI.java index 3f80241a7a..2fdfbd8dc5 100644 --- a/src/java/voldemort/tools/RebalancePlanCLI.java +++ b/src/java/voldemort/tools/RebalancePlanCLI.java @@ -37,6 +37,12 @@ import com.google.common.base.Joiner; +/* + * This tool generates a rebalance plan based on current and final xml. The plan + * will contain steps on how to rebalance the server such that its layout + * changes from the 'current' state to the 'final' state. + */ + public class RebalancePlanCLI { private final static Logger logger = Logger.getLogger(RebalancePlanCLI.class); @@ -75,8 +81,9 @@ private static void setupParser() { private static void printUsage() { StringBuilder help = new StringBuilder(); help.append("RebalancePlanCLI\n"); - help.append(" Moves partitions to achieve better balance. This can be done for shuffling (improve balance among existing nodes)," - + " cluster expansion (adding nodes to some zones), and zone expansion (adding an entire new zone).\n"); + help.append("Generates a rebalance plan based on current and final xml. The plan will " + + "contain steps on how to rebalance the server such that its layout" + + "changes from current to final state"); help.append("Options:\n"); help.append(" Required:\n"); help.append(" --current-cluster \n"); diff --git a/src/java/voldemort/tools/RepartitionerCLI.java b/src/java/voldemort/tools/RepartitionerCLI.java index 4c3902a6d0..74fded43df 100644 --- a/src/java/voldemort/tools/RepartitionerCLI.java +++ b/src/java/voldemort/tools/RepartitionerCLI.java @@ -37,6 +37,19 @@ import com.google.common.base.Joiner; +/* + * This tool accepts an existing cluster.xml and generates a new cluster.xml. + * + * The tool reads the existing cluster.xml to understand the partition layout. + * It then moves the partitions around (according to some intelligent mechanism) + * with the goal of achieving a better balanced state. A new cluster.xml is then + * generated according to what the tool believes is a better partition layout. + * + * A better balanced state might be needed for : (1) Improving balance among + * existing nodes (2) Cluster expansion (adding nodes to some zones) (3) Zone + * expansion (adding an entire new zone) + */ + public class RepartitionerCLI { private final static Logger logger = Logger.getLogger(RepartitionerCLI.class);