Examples of OptionSet


Examples of joptsimple.OptionSet

              .ofType(Integer.class);
        parser.accepts("zone-count-write", "Number of zones to write from; default 0 ")
              .withRequiredArg()
              .ofType(Integer.class);

        OptionSet options = parse(args);
        String storeName = CmdUtils.valueOf(options, "storename", "test");

        List<Integer> zoneRepFactor = getRequiredListIntegers(options, "zonerepfactor");
        int requiredReads = getRequiredInt(options, "required-reads");
        int requiredWrites = getRequiredInt(options, "required-writes");
View Full Code Here

Examples of joptsimple.OptionSet

                       "Region type; options are " + RegionInfo.REGIONURL_AP_SOUTHEAST + ", "
                               + RegionInfo.REGIONURL_EU_WEST + ", " + RegionInfo.REGIONURL_US_WEST
                               + ", " + RegionInfo.REGIONURL_US_EAST + " (default) ")
              .withRequiredArg();

        OptionSet options = parse(args);
        String accessId = getAccessId(options);
        String secretKey = getSecretKey(options);
        String regionUrl = getRegionUrl(options);

        Ec2Connection ec2Connection = new TypicaEc2Connection(accessId, secretKey, null, regionUrl);
View Full Code Here

Examples of joptsimple.OptionSet

        parser.accepts("sshprivatekey", "File containing SSH private key (optional)")
              .withRequiredArg();
        parser.accepts("hostuserid", "User ID on remote host").withRequiredArg();
        parser.accepts("commands", "File containing per-host commands").withRequiredArg();

        OptionSet options = parse(args);
        List<HostNamePair> hostNamePairs = getHostNamesPairsFromFile(getRequiredInputFile(options,
                                                                                          "hostnames"));
        List<String> hostNames = new ArrayList<String>();

        for(HostNamePair hostNamePair: hostNamePairs)
View Full Code Here

Examples of joptsimple.OptionSet

              .withValuesSeparatedBy(',');
        parser.accepts("p", "partition id")
              .withRequiredArg()
              .ofType(Integer.class)
              .withValuesSeparatedBy(',');
        OptionSet options = parser.parse(args);

        List<String> nonOptions = (List<String>) options.nonOptionArguments();

        if(args.length < 2) {
            System.out.println(usageStr);
            return;
        }

        String bootstrapUrl = nonOptions.get(0);
        String storeName = nonOptions.get(1);

        if(!options.has("p") && !options.has("n")) {
            printUsage(System.err, parser, "One or more node and/or one or more partition has"
                                           + " to be specified");
        }

        AdminTest adminTest;

        adminTest = new AdminTest(bootstrapUrl, storeName);

        SetMultimap<Integer, Integer> nodePartitions = adminTest.getNodePartitions(options.has("n") ? options.valuesOf("n")
                                                                                                   : null,
                                                                                   options.has("p") ? options.valuesOf("p")
                                                                                                   : null);

        if(options.has("f"))
            adminTest.testFetch(nodePartitions);
        if(options.has("fu"))
            adminTest.testFetchAndUpdate(nodePartitions, (Integer) options.valueOf("fu"));
    }
View Full Code Here

Examples of joptsimple.OptionSet

              .withRequiredArg();
        parser.accepts("hostuserid", "User ID on remote host").withRequiredArg();
        parser.accepts("voldemorthome", "Voldemort's home directory on remote host")
              .withRequiredArg();

        OptionSet options = parse(args);
        File hostNamesFile = getRequiredInputFile(options, "hostnames");
        File sshPrivateKey = getInputFile(options, "sshprivatekey");
        String hostUserId = CmdUtils.valueOf(options, "hostuserid", "root");
        String voldemortHomeDirectory = getRequiredString(options, "voldemorthome");
View Full Code Here

Examples of joptsimple.OptionSet

              .withRequiredArg();
        parser.accepts("hostuserid", "User ID on remote host").withRequiredArg();
        parser.accepts("parent", "Parent directory on remote host").withRequiredArg();
        parser.accepts("source", "The source directory on the local machine").withRequiredArg();

        OptionSet options = parse(args);
        File hostNamesFile = getRequiredInputFile(options, "hostnames");
        File sshPrivateKey = getInputFile(options, "sshprivatekey");
        String hostUserId = CmdUtils.valueOf(options, "hostuserid", "root");
        File sourceDirectory = getRequiredInputFile(options, "source");
        String parentDirectory = getRequiredString(options, "parent");
View Full Code Here

Examples of joptsimple.OptionSet

        parser.accepts("clustername", "Cluster name; defaults to mycluster").withRequiredArg();
        parser.accepts("useinternal", "Use internal host name; defaults to true")
              .withRequiredArg()
              .ofType(Boolean.class);

        OptionSet options = parse(args);
        List<File> hostNamesFiles = getRequiredInputFiles(options, "hostnames");
        int partitions = getRequiredInt(options, "partitions");
        String clusterName = CmdUtils.valueOf(options, "clustername", "mycluster");
        boolean useInternal = CmdUtils.valueOf(options, "useinternal", true);
View Full Code Here

Examples of joptsimple.OptionSet

                           "Percentage of requests coming from the last cache-width requests")
                  .withRequiredArg()
                  .describedAs("ratio")
                  .ofType(Double.class);
            parser.accepts("clean-up", "Delete data directory when done.");
            OptionSet options = parser.parse(args);

            if(options.has("help")) {
                parser.printHelpOn(System.out);
                System.exit(0);
            }

            CmdUtils.croakIfMissing(parser, options, "requests");

            final int numThreads = CmdUtils.valueOf(options, "threads", 10);
            final int numRequests = (Integer) options.valueOf("requests");
            final int numValues = (Integer) options.valueOf("num-values");
            final int valueSize = CmdUtils.valueOf(options, "value-size", 1024);
            final int cacheWidth = CmdUtils.valueOf(options, "cache-width", 100000);
            final double cacheHitRatio = CmdUtils.valueOf(options, "cache-hit-ratio", 0.5);
            final String propsFile = (String) options.valueOf("props");
            final boolean cleanUp = options.has("clean-up");
            final String storageEngineClass = CmdUtils.valueOf(options,
                                                               "storage-configuration-class",
                                                               BdbStorageConfiguration.class.getName())
                                                      .trim();
            File dataDir = null;
            if(options.has("data-dir"))
                dataDir = new File((String) options.valueOf("data-dir"));
            else
                dataDir = TestUtils.createTempDir();
            System.out.println("Data dir: " + dataDir);

            // create the storage engine
View Full Code Here

Examples of joptsimple.OptionSet

        OptionParser parser = new OptionParser();
        parser.accepts("client-zone-id", "client zone id for zone routing")
              .withRequiredArg()
              .describedAs("zone-id")
              .ofType(Integer.class);
        OptionSet options = parser.parse(args);

        List<String> nonOptions = (List<String>) options.nonOptionArguments();
        if(nonOptions.size() < 2 || nonOptions.size() > 3) {
            System.err.println("Usage: java VoldemortClientShell store_name bootstrap_url [command_file] [options]");
            parser.printHelpOn(System.err);
            System.exit(-1);
        }

        String storeName = nonOptions.get(0);
        String bootstrapUrl = nonOptions.get(1);
        BufferedReader inputReader = null;
        boolean fileInput = false;

        try {
            if(nonOptions.size() == 3) {
                inputReader = new BufferedReader(new FileReader(nonOptions.get(2)));
                fileInput = true;
            } else {
                inputReader = new BufferedReader(new InputStreamReader(System.in));
            }
        } catch(IOException e) {
            Utils.croak("Failure to open input stream: " + e.getMessage());
        }

        ClientConfig clientConfig = new ClientConfig().setBootstrapUrls(bootstrapUrl)
                                                      .setEnableLazy(false)
                                                      .setRequestFormatType(RequestFormatType.VOLDEMORT_V3);

        if(options.has("client-zone-id")) {
            clientConfig.setClientZoneId((Integer) options.valueOf("client-zone-id"));
        }

        VoldemortClientShell shell = new VoldemortClientShell(clientConfig,
                                                              storeName,
                                                              inputReader,
View Full Code Here

Examples of joptsimple.OptionSet

                               + failureDetectorConfig.getThresholdInterval())
              .withRequiredArg()
              .ofType(Long.class);
        parser.accepts("help", "This help");

        OptionSet options = parser.parse(args);

        if(options.has("help"))
            printUsage(parser);

        Long asyncScanInterval = CmdUtils.valueOf(options,
                                                  "async-scan-interval",
                                                  failureDetectorConfig.getAsyncRecoveryInterval());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.