Package com.persistit.util

Examples of com.persistit.util.ArgParser


                final Command command = COMMANDS.get(commandName);
                if (command != null) {
                    list.remove(0);
                    try {
                        final String[] args = list.toArray(new String[list.size()]);
                        final ArgParser ap = new ArgParser(commandName, args, command.argTemplate).strict();
                        if (!ap.isUsageOnly()) {
                            final String result = command.execute(this, ap);
                            if (result != null) {
                                _writer.println(result);
                            }
                            _lastStatus += " - done";
View Full Code Here


        _action = new SimpleDumpAction();
        _selectedTypes.set(0, 65535, true);
    }

    public void init(final String[] args) {
        final ArgParser ap = new ArgParser("com.persistit.JournalTool", args, ARGS_TEMPLATE).strict();
        if (ap.isUsageOnly()) {
            return;
        }
        init(ap);
    }
View Full Code Here

        final JournalManagerBench jmb = new JournalManagerBench(args);
        jmb.runTest();
    }

    private JournalManagerBench(final String[] args) throws Exception {
        ap = new ArgParser("JournalManagerBench", args, ARG_TEMPLATE).strict();
        buffer = ByteBuffer.allocate(ap.getIntValue("buffersize") * 1024 * 1024);
    }
View Full Code Here

        }

    }

    public static void main(final String[] args) throws Exception {
        final ArgParser ap = new ArgParser("VolumeHeader", args, ARGS_TEMPLATE).strict();
        if (ap.isUsageOnly()) {
            return;
        }
        final Task task = new VolumeInfoTask(ap.getStringValue("path"));
        task.setMessageWriter(new PrintWriter(System.out));
        task.runTask();
    }
View Full Code Here

     *
     * @param args
     * @throws Exception
     */
    public static void main(final String[] args) throws Exception {
        final ArgParser ap = new ArgParser("Persistit", args, ARG_TEMPLATE).strict();
        if (ap.isUsageOnly()) {
            return;
        }

        Persistit persistit = null;
        final String propertiesFileName = ap.getStringValue("properties");
        if (!propertiesFileName.isEmpty()) {
            persistit = new Persistit();
            persistit.setPropertiesFromFile(propertiesFileName);
            persistit.initialize();
        }
        final String scriptName = ap.getStringValue("script");

        final int cliport = ap.getIntValue("cliport");

        if (cliport > -1 && !propertiesFileName.isEmpty()) {
            throw new IllegalArgumentException("Specify only one: properties or cliport");
        }

        if (cliport > 1) {
            System.out.printf("Starting a Persistit CLI server on port %d\n", cliport);
            final Task task = CLI.cliserver(cliport);
            task.runTask();
            task.setPersistit(persistit);
        } else if (!scriptName.isEmpty()) {
            final BufferedReader reader = new BufferedReader(new FileReader(scriptName));
            final PrintWriter writer = new PrintWriter(System.out);
            CLI.runScript(persistit, reader, writer);
        } else {
            if (persistit == null) {
                throw new IllegalArgumentException("Must specify a properties file");
            }
            final boolean gui = ap.isFlag('g');
            final boolean icheck = ap.isFlag('i');
            final boolean wait = ap.isFlag('w');
            final boolean copy = ap.isFlag('c');

            try {
                if (gui) {
                    persistit.setupGUI(wait);
                }
View Full Code Here

    public static void main(final String[] args) throws Exception {
        final String[] template = {
                "path||pathname of journal, e.g., /xxx/yyy/zzz_journal "
                        + "for files such as /xxx/yyy/zzz_journal.0000000000000047",
                "_flags|t|emit transaction details" };
        final ArgParser argParser = new ArgParser("RecoveryManager", args, template).strict();
        final Persistit persistit = new Persistit();
        persistit.initializeJournal();
        final RecoveryManager rman = new RecoveryManager(persistit);
        rman.init(argParser.getStringValue("path"));
        rman.analyze();
    }
View Full Code Here

TOP

Related Classes of com.persistit.util.ArgParser

Copyright © 2018 www.massapicom. 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.