Example usage for org.apache.hadoop.util ProgramDriver run

List of usage examples for org.apache.hadoop.util ProgramDriver run

Introduction

In this page you can find the example usage for org.apache.hadoop.util ProgramDriver run.

Prototype

public int run(String[] args) throws Throwable 

Source Link

Document

This is a driver for the example programs.

Usage

From source file:$.Driver.java

License:Apache License

public static void main(String[] args) {
        int exitCode = -1;
        ProgramDriver pgd = new ProgramDriver();
        try {/*from   w  w  w  .j a  va2  s. c om*/
            pgd.addClass("yarnjob", YarnJob.class, "Yarn Job");
            pgd.addClass("wc", YarnWordCount.class, "Word Count");
            exitCode = pgd.run(args);
        } catch (Throwable e) {
            e.printStackTrace();
        }
        System.exit(exitCode);
    }

From source file:cn.edu.buaa.practice.util.KPIJobsBootstrap.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {/*from  www.j a v  a2  s .  co  m*/
        pgd.addClass("pvcount", PVCountJob.class, "MR job to count pv.");
        pgd.addClass("uvcount", IPCountJob.class, "MR job to count uv.");
        pgd.addClass("timecount", HourPvCountJob.class, "MR job to count by datetime/hour.");
        pgd.addClass("browsercount", BrowserCountJob.class, "MR job to count browser.");
        pgd.addClass("devicecount", DeviceTypeCountJob.class, "MR job to count by device type.");
        pgd.addClass("sourcecount", SourceCountJob.class, "MR job to count by source/referer.");
        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    System.exit(exitCode);
}

From source file:com.checkup.tez.test.DriverTest.java

@Test
public void hello() {
    String[] argv = new String[] {};
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {// w w  w.  j  ava 2 s .  co m
        pgd.addClass("broadcastloadgen", BroadcastLoadGen.class,
                "Run a DAG to generate load for Broadcast Shuffle");
        pgd.addClass("rpcloadgen", RPCLoadGen.class, "Run a DAG to generate load for the task to AM RPC");
        pgd.addClass("wordcount", MapredWordCount.class,
                "A map/reduce program that counts the words in the input files.");
        pgd.addClass("mapredwordcount", MapredWordCount.class,
                "A map/reduce program that counts the words in the input files" + " using the mapred apis.");
        pgd.addClass("randomwriter", RandomWriter.class,
                "A map/reduce program that writes 10GB of random data per node.");
        pgd.addClass("randomtextwriter", RandomTextWriter.class,
                "A map/reduce program that writes 10GB of random textual data per node.");
        pgd.addClass("sort", Sort.class,
                "A map/reduce program that sorts the data written by the random" + " writer.");
        pgd.addClass("secondarysort", SecondarySort.class,
                "An example defining a secondary sort to the reduce.");
        pgd.addClass("join", Join.class,
                "A job that effects a join over sorted, equally partitioned" + " datasets");
        pgd.addClass("groupbyorderbymrrtest", GroupByOrderByMRRTest.class,
                "A map-reduce-reduce program that does groupby-order by. Takes input"
                        + " containing employee_name department name per line of input"
                        + " and generates count of employees per department and" + " sorted on employee count");
        pgd.addClass("mrrsleep", MRRSleepJob.class, "MRR Sleep Job");
        pgd.addClass("testorderedwordcount", TestOrderedWordCount.class,
                "Word Count with words sorted on frequency");
        pgd.addClass("unionexample", UnionExample.class, "Union example");
        pgd.addClass("broadcastAndOneToOneExample", BroadcastAndOneToOneExample.class,
                "BroadcastAndOneToOneExample example");
        pgd.addClass("filterLinesByWord", FilterLinesByWord.class,
                "Filters lines by the specified word using broadcast edge");
        pgd.addClass("filterLinesByWordOneToOne", FilterLinesByWordOneToOne.class,
                "Filters lines by the specified word using OneToOne edge");
        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    //System.exit(exitCode);

}

From source file:com.example.bigtable.sample.WordCountDriver.java

License:Open Source License

public static void main(String[] args) {
    ProgramDriver programDriver = new ProgramDriver();
    int exitCode = -1;
    try {//from w  ww  .  j ava  2s.com
        programDriver.addClass("wordcount-hbase", WordCountHBase.class,
                "A map/reduce program that counts the words in the input files.");
        programDriver.addClass("export-table", Export.class,
                "A map/reduce program that exports a table to a file.");
        //programDriver.addClass("cellcounter", CellCounter.class, "Count them cells!");
        programDriver.driver(args);
        exitCode = programDriver.run(args);
    } catch (Throwable e) {
        e.printStackTrace();
    }
    System.exit(exitCode);
}

From source file:com.google.cloud.bigtable.mapreduce.Driver.java

License:Open Source License

public static void main(String[] args) {
    ProgramDriver programDriver = new ProgramDriver();
    int exitCode = -1;
    try {//from  w  w w.j  ava2 s . co  m
        programDriver.addClass("export-table", Export.class,
                "A map/reduce program that exports a table to a file.");
        programDriver.addClass("import-table", Import.class,
                "A map/reduce program that imports a table to a file.");
        programDriver.driver(args);
        exitCode = programDriver.run(args);
    } catch (Throwable e) {
        e.printStackTrace();
    }
    System.exit(exitCode);
}

From source file:com.hiido.eagle.hes.mr.JobDriver.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {/*from   w ww  .j av a  2 s  .  c  om*/
        pgd.addClass(HesImportJob.NAME, HesImportJob.class, HesImportJob.NAME);

        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    System.exit(exitCode);
}

From source file:com.micmiu.hadoop.mr.demo.ExampleDriver.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {//from w  ww .j  ava2s. c o  m
        pgd.addClass("wordcount", WordCount.class,
                "A map/reduce program that counts the words in the input files.");

        pgd.addClass("xflowstatic", XflowStatic.class,
                "A map/reduce program that static xflow from data files.");

        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    System.exit(exitCode);
}

From source file:com.phantom.hadoop.examples.ExampleDriver.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {/*from   ww w. java2 s .c o  m*/
        pgd.addClass("wordcount", WordCount.class,
                "A map/reduce program that counts the words in the input files.");
        pgd.addClass("wordmean", WordMean.class,
                "A map/reduce program that counts the average length of the words in the input files.");
        pgd.addClass("wordmedian", WordMedian.class,
                "A map/reduce program that counts the median length of the words in the input files.");
        pgd.addClass("wordstandarddeviation", WordStandardDeviation.class,
                "A map/reduce program that counts the standard deviation of the length of the words in the input files.");
        pgd.addClass("aggregatewordcount", AggregateWordCount.class,
                "An Aggregate based map/reduce program that counts the words in the input files.");
        pgd.addClass("aggregatewordhist", AggregateWordHistogram.class,
                "An Aggregate based map/reduce program that computes the histogram of the words in the input files.");
        pgd.addClass("grep", Grep.class,
                "A map/reduce program that counts the matches of a regex in the input.");
        pgd.addClass("randomwriter", RandomWriter.class,
                "A map/reduce program that writes 10GB of random data per node.");
        pgd.addClass("randomtextwriter", RandomTextWriter.class,
                "A map/reduce program that writes 10GB of random textual data per node.");
        pgd.addClass("sort", Sort.class,
                "A map/reduce program that sorts the data written by the random writer.");

        pgd.addClass("pi", QuasiMonteCarlo.class, QuasiMonteCarlo.DESCRIPTION);
        pgd.addClass("bbp", BaileyBorweinPlouffe.class, BaileyBorweinPlouffe.DESCRIPTION);
        pgd.addClass("distbbp", DistBbp.class, DistBbp.DESCRIPTION);

        pgd.addClass("pentomino", DistributedPentomino.class,
                "A map/reduce tile laying program to find solutions to pentomino problems.");
        pgd.addClass("secondarysort", SecondarySort.class,
                "An example defining a secondary sort to the reduce.");
        pgd.addClass("sudoku", Sudoku.class, "A sudoku solver.");
        pgd.addClass("join", Join.class, "A job that effects a join over sorted, equally partitioned datasets");
        pgd.addClass("multifilewc", MultiFileWordCount.class, "A job that counts words from several files.");
        pgd.addClass("dbcount", DBCountPageView.class,
                "An example job that count the pageview counts from a database.");
        pgd.addClass("teragen", TeraGen.class, "Generate data for the terasort");
        pgd.addClass("terasort", TeraSort.class, "Run the terasort");
        pgd.addClass("teravalidate", TeraValidate.class, "Checking results of terasort");
        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    System.exit(exitCode);
}

From source file:com.zfylin.demo.bigdata.hadoop.mr.ExampleDriver.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {/*from   w ww . ja va2 s  . com*/
        pgd.addClass("wordcount", WordCount2.class,
                "A map/reduce program that counts the words in the input files.");

        pgd.addClass("xflowstatic", XflowStatic.class,
                "A map/reduce program that static xflow from data files.");

        exitCode = pgd.run(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }

    System.exit(exitCode);
}

From source file:org.apache.flink.tez.examples.ExampleDriver.java

License:Apache License

public static void main(String[] args) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {/* w  w  w.  j a  v  a  2s.c om*/
        pgd.addClass("wc", WordCount.class, "Wordcount");
        pgd.addClass("tpch3", TPCHQuery3.class, "Modified TPC-H 3 query");
        pgd.addClass("tc", TransitiveClosureNaiveStep.class, "One step of transitive closure");
        pgd.addClass("pr", PageRankBasicStep.class, "One step of PageRank");
        pgd.addClass("cc", ConnectedComponentsStep.class, "One step of connected components");
        exitCode = pgd.run(args);
    } catch (Throwable e) {
        e.printStackTrace();
    }
    System.exit(exitCode);
}