Search in sources :

Example 26 with CmdLineParser

use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.

the class SecondaryIndexBulkLoadExample method main.

public static void main(String[] args) throws Exception {
    Options options = new Options();
    CmdLineParser parser = new CmdLineParser(options);
    parser.parseArgument(args);
    IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
    JobSpecification job = createJob(options);
    long start = System.currentTimeMillis();
    JobId jobId = hcc.startJob(job);
    hcc.waitForCompletion(jobId);
    long end = System.currentTimeMillis();
    System.err.println(start + " " + end + " " + (end - start));
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) CmdLineParser(org.kohsuke.args4j.CmdLineParser) JobSpecification(org.apache.hyracks.api.job.JobSpecification) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) JobId(org.apache.hyracks.api.job.JobId)

Example 27 with CmdLineParser

use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.

the class InsertPipelineExample method main.

public static void main(String[] args) throws Exception {
    Options options = new Options();
    CmdLineParser parser = new CmdLineParser(options);
    parser.parseArgument(args);
    IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
    JobSpecification job = createJob(options);
    long start = System.currentTimeMillis();
    JobId jobId = hcc.startJob(job);
    hcc.waitForCompletion(jobId);
    long end = System.currentTimeMillis();
    System.err.println(start + " " + end + " " + (end - start));
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) CmdLineParser(org.kohsuke.args4j.CmdLineParser) JobSpecification(org.apache.hyracks.api.job.JobSpecification) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) JobId(org.apache.hyracks.api.job.JobId)

Example 28 with CmdLineParser

use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.

the class LSMExperimentSetRunner method main.

public static void main(String[] args) throws Exception {
    //        LogManager.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
    LSMExperimentSetRunnerConfig config = new LSMExperimentSetRunnerConfig(String.valueOf(System.currentTimeMillis()), 3);
    CmdLineParser clp = new CmdLineParser(config);
    try {
        clp.parseArgument(args);
    } catch (CmdLineException e) {
        System.err.println(e.getMessage());
        clp.printUsage(System.err);
        System.exit(1);
    }
    Collection<AbstractExperimentBuilder> suite = new ArrayList<>();
    /*
                suite.add(new Experiment7BBuilder(config));
                suite.add(new Experiment7DBuilder(config));
                suite.add(new Experiment7ABuilder(config));
                suite.add(new Experiment8DBuilder(config));
                suite.add(new Experiment8ABuilder(config));
                suite.add(new Experiment8BBuilder(config));
                suite.add(new Experiment9ABuilder(config));
                suite.add(new Experiment9DBuilder(config));
                suite.add(new Experiment9BBuilder(config));
                suite.add(new Experiment6ABuilder(config));
                suite.add(new Experiment6BBuilder(config));
                suite.add(new Experiment6CBuilder(config));
                suite.add(new Experiment2D1Builder(config));
                suite.add(new Experiment2D2Builder(config));
                suite.add(new Experiment2D4Builder(config));
                suite.add(new Experiment2D8Builder(config));
                suite.add(new Experiment2C1Builder(config));
                suite.add(new Experiment2C2Builder(config));
                suite.add(new Experiment2C4Builder(config));
                suite.add(new Experiment2C8Builder(config));
                suite.add(new Experiment2A1Builder(config));
                suite.add(new Experiment2A2Builder(config));
                suite.add(new Experiment2A4Builder(config));
                suite.add(new Experiment2A8Builder(config));
                suite.add(new Experiment2B1Builder(config));
                suite.add(new Experiment2B2Builder(config));
                suite.add(new Experiment2B4Builder(config));
                suite.add(new Experiment2B8Builder(config));
                suite.add(new Experiment1ABuilder(config));
                suite.add(new Experiment1BBuilder(config));
                suite.add(new Experiment1CBuilder(config));
                suite.add(new Experiment1DBuilder(config));
                suite.add(new Experiment1EBuilder(config));
                suite.add(new Experiment4ABuilder(config));
                suite.add(new Experiment4BBuilder(config));
                suite.add(new Experiment4CBuilder(config));
                suite.add(new Experiment4DBuilder(config));
                suite.add(new Experiment3ABuilder(config));
                suite.add(new Experiment3BBuilder(config));
                suite.add(new Experiment3CBuilder(config));
                suite.add(new Experiment3DBuilder(config));
                suite.add(new Experiment5ABuilder(config));
                suite.add(new Experiment5BBuilder(config));
                suite.add(new Experiment5CBuilder(config));
                suite.add(new Experiment5DBuilder(config));
        */
    suite.add(new PerfTestAggBuilder(config));
    suite.add(new PresetClusterPerfBuilder(config));
    Pattern p = config.getRegex() == null ? null : Pattern.compile(config.getRegex());
    SequentialActionList exps = new SequentialActionList();
    for (AbstractExperimentBuilder eb : suite) {
        if (p == null || p.matcher(eb.getName()).matches()) {
            exps.add(eb.build());
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.info("Added " + eb.getName() + " to run list...");
            }
        }
    }
    exps.perform();
}
Also used : Pattern(java.util.regex.Pattern) AbstractExperimentBuilder(org.apache.asterix.experiment.builder.AbstractExperimentBuilder) PerfTestAggBuilder(org.apache.asterix.experiment.builder.PerfTestAggBuilder) CmdLineParser(org.kohsuke.args4j.CmdLineParser) SequentialActionList(org.apache.asterix.experiment.action.base.SequentialActionList) ArrayList(java.util.ArrayList) CmdLineException(org.kohsuke.args4j.CmdLineException) PresetClusterPerfBuilder(org.apache.asterix.experiment.builder.PresetClusterPerfBuilder)

Example 29 with CmdLineParser

use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.

the class SocketTweetGeneratorDriver method main.

public static void main(String[] args) throws Exception {
    SocketTweetGeneratorConfig clientConfig = new SocketTweetGeneratorConfig();
    CmdLineParser clp = new CmdLineParser(clientConfig);
    try {
        clp.parseArgument(args);
    } catch (CmdLineException e) {
        System.err.println(e.getMessage());
        clp.printUsage(System.err);
        System.exit(1);
    }
    if ((clientConfig.getDataInterval() == -1 && clientConfig.getDataGenDuration() == -1) || (clientConfig.getDataInterval() > 0 && clientConfig.getDataGenDuration() > 0)) {
        System.err.println("Must use exactly one of -d or -di");
        clp.printUsage(System.err);
        System.exit(1);
    }
    SocketTweetGenerator client = new SocketTweetGenerator(clientConfig);
    client.start();
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Example 30 with CmdLineParser

use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.

the class SpatialQueryGeneratorDriver method main.

public static void main(String[] args) throws Exception {
    SpatialQueryGeneratorConfig clientConfig = new SpatialQueryGeneratorConfig();
    CmdLineParser clp = new CmdLineParser(clientConfig);
    try {
        clp.parseArgument(args);
    } catch (CmdLineException e) {
        System.err.println(e.getMessage());
        clp.printUsage(System.err);
        System.exit(1);
    }
    SpatialQueryGenerator client = new SpatialQueryGenerator(clientConfig);
    client.start();
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Aggregations

CmdLineParser (org.kohsuke.args4j.CmdLineParser)208 CmdLineException (org.kohsuke.args4j.CmdLineException)165 IOException (java.io.IOException)45 File (java.io.File)27 Test (org.junit.Test)14 KeeperException (org.apache.zookeeper.KeeperException)12 ArrayList (java.util.ArrayList)11 HyracksConnection (org.apache.hyracks.api.client.HyracksConnection)10 IHyracksClientConnection (org.apache.hyracks.api.client.IHyracksClientConnection)10 Directory (org.apache.lucene.store.Directory)10 FSDirectory (org.apache.lucene.store.FSDirectory)10 JobId (org.apache.hyracks.api.job.JobId)9 JobSpecification (org.apache.hyracks.api.job.JobSpecification)9 ClientException (com.ms.silverking.cloud.dht.client.ClientException)8 PutException (com.ms.silverking.cloud.dht.client.PutException)8 SKGridConfiguration (com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration)8 PrintStream (java.io.PrintStream)8 List (java.util.List)8 RetrievalException (com.ms.silverking.cloud.dht.client.RetrievalException)7 IndexArgs (io.anserini.index.IndexArgs)7