Skip to content

Commit

Permalink
Fix final-cluster to be required arg of RebalancePlanCLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjwylie committed Jun 20, 2013
1 parent 77f3b69 commit f55aace
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/java/voldemort/tools/RebalancePlanCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ private static void printUsage() {
help.append(" Required:\n");
help.append(" --current-cluster <clusterXML>\n");
help.append(" --current-stores <storesXML>\n");
help.append(" --final-cluster <clusterXML>\n");
help.append(" Optional:\n");
help.append(" --final-cluster <clusterXML> [ Needed for cluster or zone expansion ]\n");
help.append(" --final-stores <storesXML> [ Needed for zone expansion ]\n");
help.append(" --batch <batch> [ Number of primary partitions to move in each rebalancing batch. ]\n");
help.append(" --output-dir <outputDir> [ Directory in which cluster metadata is dumped for each batch of the plan. ]\n");
Expand Down Expand Up @@ -120,7 +120,10 @@ private static OptionSet getValidOptions(String[] args) {
System.exit(0);
}

Set<String> missing = CmdUtils.missing(options, "current-cluster", "current-stores");
Set<String> missing = CmdUtils.missing(options,
"current-cluster",
"current-stores",
"final-cluster");
if(missing.size() > 0) {
printUsageAndDie("Missing required arguments: " + Joiner.on(", ").join(missing));
}
Expand All @@ -138,12 +141,9 @@ public static void main(String[] args) throws Exception {
// Required args
String currentClusterXML = (String) options.valueOf("current-cluster");
String currentStoresXML = (String) options.valueOf("current-stores");
String finalClusterXML = (String) options.valueOf("final-cluster");

// Required args for some use cases
String finalClusterXML = new String(currentClusterXML);
if(options.has("final-cluster")) {
finalClusterXML = (String) options.valueOf("final-cluster");
}
String finalStoresXML = new String(currentStoresXML);
if(options.has("final-stores")) {
finalStoresXML = (String) options.valueOf("final-stores");
Expand Down

0 comments on commit f55aace

Please sign in to comment.