Search in sources :

Example 91 with OptionParser

use of joptsimple.OptionParser in project voldemort by voldemort.

the class KeyVersionFetcherCLI method getParser.

/**
     * Return args parser
     * 
     * @return program parser
     * */
private static OptionParser getParser() {
    OptionParser parser = new OptionParser();
    parser.accepts("help", "print help information");
    parser.accepts("url", "[REQUIRED] bootstrap URL").withRequiredArg().describedAs("bootstrap-url").ofType(String.class);
    parser.accepts("in-dir", "[REQUIRED] Directory in which to find the input key files (named \"{storeName}.kvs\", generated by KeyFetcherCLI.").withRequiredArg().describedAs("inputDirectory").ofType(String.class);
    parser.accepts("out-dir", "[REQUIRED] Directory in which to output the key files (named \"{storeName}.kvs\".").withRequiredArg().describedAs("outputDirectory").ofType(String.class);
    parser.accepts("store-names", "Store names to sample. Comma delimited list or singleton. [Default: ALL]").withRequiredArg().describedAs("storeNames").withValuesSeparatedBy(',').ofType(String.class);
    parser.accepts("parallelism", "Number of key-versions to sample in parallel. [Default: " + DEFAULT_KEY_PARALLELISM + " ]").withRequiredArg().describedAs("storeParallelism").ofType(Integer.class);
    parser.accepts("progress-period-ops", "Number of operations between progress info is displayed. [Default: " + DEFAULT_PROGRESS_PERIOD_OPS + " ]").withRequiredArg().describedAs("progressPeriodOps").ofType(Integer.class);
    parser.accepts("output-batch-size", "Number of keys fetched and written out in sorted order at once. [Default: " + DEFAULT_OUTPUT_BATCH_SIZE + " ]").withRequiredArg().describedAs("outputBatchSize").ofType(Integer.class);
    parser.accepts("details", "print details of each key-version: partition ID, node ID, & hostname");
    return parser;
}
Also used : OptionParser(joptsimple.OptionParser)

Example 92 with OptionParser

use of joptsimple.OptionParser in project voldemort by voldemort.

the class DeleteKeysCLI method setupParser.

private static OptionParser setupParser() {
    OptionParser parser = new OptionParser();
    parser.accepts("help", "Print usage information").withOptionalArg();
    parser.accepts("url", "bootstrapUrl").withRequiredArg().describedAs("bootstrap url");
    parser.accepts("zone", "Zone id").withRequiredArg().describedAs("zone id").ofType(Integer.class).defaultsTo(-1);
    parser.accepts("stores", "store").withRequiredArg().describedAs("stores to delete the key/value from").withValuesSeparatedBy(',').ofType(String.class);
    parser.accepts("keyfile", "key file").withRequiredArg().describedAs("file with keys to be deleted are stored as one per line");
    parser.accepts("qps", "keys to be deleted per store").withRequiredArg().describedAs("number of operations allowed per second per store").ofType(Integer.class).defaultsTo(100);
    parser.accepts("delete-all-versions", "Deletes all versions for a given key").withOptionalArg();
    parser.accepts("nodeid", "Delete keys if it is hosted in a node").withRequiredArg().describedAs("Delete keys belonging to a node").ofType(Integer.class).defaultsTo(-1);
    parser.accepts("admin-url", "admin url").withRequiredArg().describedAs("admin url");
    parser.accepts("check-keys-exist", "Verify if the number of keys exist").withRequiredArg().describedAs("Check if the given number of keys exist in the store").ofType(Integer.class).defaultsTo(100);
    return parser;
}
Also used : OptionParser(joptsimple.OptionParser)

Example 93 with OptionParser

use of joptsimple.OptionParser in project voldemort by voldemort.

the class RebalancePlanCLI method setupParser.

private static void setupParser() {
    parser = new OptionParser();
    parser.accepts("help", "Print usage information");
    parser.accepts("current-cluster", "Path to current cluster xml").withRequiredArg().describedAs("cluster.xml");
    parser.accepts("final-cluster", "Path to final cluster xml").withRequiredArg().describedAs("cluster.xml");
    parser.accepts("current-stores", "Path to current store definition xml. Needed for cluster and zone expansion.").withRequiredArg().describedAs("stores.xml");
    parser.accepts("final-stores", "Path to final store definition xml. Needed for zone expansion.").withRequiredArg().describedAs("stores.xml");
    parser.accepts("batch-size", "Number of primary partitions to move together [ Default : " + RebalancePlan.BATCH_SIZE + " ]").withRequiredArg().ofType(Integer.class).describedAs("num-primary-partitions");
    parser.accepts("output-dir", "Output directory in which to dump per-batch metadata").withRequiredArg().ofType(String.class).describedAs("path");
}
Also used : OptionParser(joptsimple.OptionParser)

Example 94 with OptionParser

use of joptsimple.OptionParser in project voldemort by voldemort.

the class ZoneShrinkageCLI method getParser.

public static OptionParser getParser() {
    OptionParser parser = new OptionParser();
    parser.acceptsAll(Arrays.asList("u", "url"), "Bootstrap URL of target cluster").withRequiredArg().ofType(String.class).describedAs("bootstrap-url");
    parser.acceptsAll(Arrays.asList("i", "drop-zoneid"), "ID of the zone to be dropped").withRequiredArg().ofType(Integer.class).describedAs("zone-id");
    parser.acceptsAll(Arrays.asList("real-run"), "If and only if this option is specified, the program will actually execute the shrinkage(Real Run). Otherwise, it will not actually execute the shrinkage");
    parser.acceptsAll(Arrays.asList("h", "help"), "Show help message");
    return parser;
}
Also used : OptionParser(joptsimple.OptionParser)

Example 95 with OptionParser

use of joptsimple.OptionParser in project voldemort by voldemort.

the class ZoneClipperCLI method setupParser.

private static void setupParser() {
    parser = new OptionParser();
    parser.accepts("help", "Print usage information");
    parser.accepts("current-cluster", "Path to current cluster xml").withRequiredArg().describedAs("cluster.xml");
    parser.accepts("current-stores", "Path to current stores xml").withRequiredArg().describedAs("stores.xml");
    parser.accepts("output-dir", "Specify the output directory for the new cluster.xml").withRequiredArg().ofType(String.class).describedAs("path");
    parser.accepts("drop-zoneid", "Zone id that you want to drop.").withRequiredArg().describedAs("zoneid-to-drop").ofType(Integer.class);
}
Also used : OptionParser(joptsimple.OptionParser)

Aggregations

OptionParser (joptsimple.OptionParser)118 OptionSet (joptsimple.OptionSet)91 File (java.io.File)35 IOException (java.io.IOException)15 OptionException (joptsimple.OptionException)14 List (java.util.List)13 Test (org.junit.Test)13 ArrayList (java.util.ArrayList)11 Cluster (voldemort.cluster.Cluster)8 FileNotFoundException (java.io.FileNotFoundException)6 StoreDefinition (voldemort.store.StoreDefinition)6 Closer (com.google.common.io.Closer)5 BufferedReader (java.io.BufferedReader)5 Properties (java.util.Properties)5 OptionSpec (joptsimple.OptionSpec)5 Node (voldemort.cluster.Node)5 ByteArray (voldemort.utils.ByteArray)5 ClusterMapper (voldemort.xml.ClusterMapper)5 MongoClientURI (com.mongodb.MongoClientURI)4 FileReader (java.io.FileReader)4