Examples of OptionSet


Examples of joptsimple.OptionSet

            List<String> keyStrings = null;
            String storeName = null;
            String url = null;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_STORE);
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);
            AdminParserUtils.checkRequired(options,
                                           AdminParserUtils.OPT_HEX,
                                           AdminParserUtils.OPT_JSON);

            // load parameters
            if(options.has(AdminParserUtils.OPT_HEX)) {
                keyType = AdminParserUtils.OPT_HEX;
                keyStrings = (List<String>) options.valuesOf(AdminParserUtils.OPT_HEX);
            } else if(options.has(AdminParserUtils.OPT_JSON)) {
                keyType = AdminParserUtils.OPT_JSON;
                keyStrings = (List<String>) options.valuesOf(AdminParserUtils.OPT_JSON);
                throw new VoldemortException("Key type OPT_JSON not supported.");
            }
            storeName = (String) options.valueOf(AdminParserUtils.OPT_STORE);
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doDebugRoute(adminClient, storeName, keyStrings, keyType);
View Full Code Here

Examples of joptsimple.OptionSet

            List<Integer> nodeIds = null;
            Boolean allNodes = true;
            Boolean confirm = false;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);
            AdminParserUtils.checkOptional(options,
                                           AdminParserUtils.OPT_NODE,
                                           AdminParserUtils.OPT_ALL_NODES);

            // load parameters
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);
            if(options.has(AdminParserUtils.OPT_NODE)) {
                nodeIds = (List<Integer>) options.valuesOf(AdminParserUtils.OPT_NODE);
                allNodes = false;
            }
            if(options.has(AdminParserUtils.OPT_CONFIRM)) {
                confirm = true;
            }

            // print summary
            System.out.println("Remove orphaned data after rebalancing");
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.