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

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

Introduction

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

Prototype

public void addClass(String name, Class<?> mainClass, String description) throws Throwable 

Source Link

Document

This is the method that adds the classed to the repository

Usage

From source file:$.Driver.java

License:Apache License

public static void main(String[] args) {
        int exitCode = -1;
        ProgramDriver pgd = new ProgramDriver();
        try {/*from  ww  w. j a  v  a 2 s .  c o m*/
            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:boostingPL.driver.BoostingPLDriver.java

License:Open Source License

private static void addClass(ProgramDriver driver, String classString, String descString) {
    try {/*from w w w . j a v a 2  s .co  m*/
        Class<?> clazz = Class.forName(classString);
        driver.addClass(shortName(descString), clazz, desc(descString));
    } catch (ClassNotFoundException e) {
        LOG.warn("Unable to add class: {}", classString, e);
    } catch (Throwable t) {
        LOG.warn("Unable to add class: {}", classString, t);
    }
}

From source file:ca.dealsaccess.scout.driver.ScoutDriver.java

License:Apache License

private static void addClass(ProgramDriver driver, String classString, String descString) {
    try {/*from   w  w w  . ja va2  s.c om*/
        Class<?> clazz = Class.forName(classString);
        driver.addClass(shortName(descString), clazz, desc(descString));
    } catch (ClassNotFoundException e) {
        log.warn("Unable to add class: {}", classString, e);
    } catch (Throwable t) {
        log.warn("Unable to add class: {}", classString, t);
    }
}

From source file:ca.etsmtl.lasi.hbasewikipedialoader.Driver.java

License:Apache License

/**
 * @param args//w  ww  .j  a va 2s.co  m
 * @throws Throwable 
 */
public static void main(String[] args) throws Throwable {
    ProgramDriver pgd = new ProgramDriver();
    pgd.addClass(HBaseWikipediaLoader.NAME, HBaseWikipediaLoader.class,
            "Load the Wikipedia articles dump in a HBase table");
    pgd.driver(args);
}

From source file:ca.uwaterloo.iss4e.hadoop.Driver.java

License:Open Source License

public static void main(String argv[]) {
    ProgramDriver pgd = new ProgramDriver();
    try {//  w ww. j  a va  2  s. c  o  m
        pgd.addClass("ThreelMain", ThreelMain.class, "Threeline program");
        pgd.driver(argv);
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

From source file:cn.clickwise.bigdata.Main.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {//from   w w  w .  ja  v a  2 s .  c o  m
        pgd.addClass("preprocess", Preprocess.class,
                "A map/reduce program that preprocess all the input data sources.");

        pgd.driver(argv);

        // Success
        exitCode = 0;
    } 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 {//w  w  w.  j av  a 2s  .  c o 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.ailk.oci.ocnosql.tools.Driver.java

License:Apache License

/**
 * @param args//from   w w w .  j  a va2 s  .  c  o m
 * @throws Throwable
 */
public static void main(String[] args) throws Throwable {
    ProgramDriver pgd = new ProgramDriver();
    pgd.addClass(SingleColumnImportTsv.NAME, SingleColumnImportTsv.class,
            "Import data as single column in TSV format.");
    pgd.addClass(MutipleColumnImportTsv.NAME, MutipleColumnImportTsv.class,
            "Import data as mutiple column in TSV format.");
    pgd.addClass(Export.NAME, Export.class, "Export data from a Htable by mapreduce");
    pgd.addClass(CsvBulkLoadTool.NAME, CsvBulkLoadTool.class, "phoenix csvBulkLoad");
    ProgramDriver.class.getMethod("driver", new Class[] { String[].class }).invoke(pgd, new Object[] { args });
}

From source file:com.benchmark.mapred.ExampleDriver.java

License:Apache License

public static void main(String argv[]) {
    int exitCode = -1;

    ProgramDriver pgd = new ProgramDriver();
    try {/*w w w  .j av a  2s .  c  o m*/
        pgd.addClass("wordcount", WordCount.class,
                "A map/reduce program that counts 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", PiEstimator.class,
                "A map/reduce program that estimates Pi using monte-carlo method.");
        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("sleep", SleepJob.class, "A job that sleeps at each map and reduce task.");
        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");
        pgd.addClass("kmeans", Kmeans.class, "Kmeans on movies data");
        pgd.addClass("classification", Classification.class, "Classify movies into clusters");
        pgd.addClass("histogram_movies", HistogramMovies.class,
                "A map/reduce program that gives a histogram of movies based on ratings.");
        pgd.addClass("histogram_ratings", HistogramRatings.class,
                "A map/reduce program that gives a histogram of users ratings on movies.");
        pgd.addClass("selfjoin", SelfJoin.class,
                "A map/reduce program that creates k+1 associations given set of k-field associations");
        pgd.addClass("invertedindex", InvertedIndex.class,
                "A map/reduce program that creates an inverted index of documents.");
        pgd.addClass("adjlist", AdjList.class,
                "A map/reduce program that finds adjacency list of graph nodes.");
        pgd.addClass("termvectorperhost", TermVectorPerHost.class,
                "A map/reduce program that creates the term-vectors (frequency of words) per document.");
        pgd.addClass("sequencecount", SequenceCount.class,
                "A map/reduce program that counts the occurrence of consecutive words in the input files.");
        pgd.addClass("rankedinvertedindex", RankedInvertedIndex.class,
                "A map/reduce program that creates the top k document lists per word");

        pgd.driver(argv);

        // Success
        exitCode = 0;
    } 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 {/* ww  w  .  j  av  a2 s. c o 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);

}