+/EE360P

distributed systems

git clone https://git.julia.blue/+/EE360P

vijaygarg1init07ca65d

master
4.2 KiB83 linesraw
1/**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19package org.apache.hadoop.examples;
20
21import org.apache.hadoop.examples.dancing.DistributedPentomino;
22import org.apache.hadoop.examples.dancing.Sudoku;
23import org.apache.hadoop.examples.pi.DistBbp;
24import org.apache.hadoop.examples.terasort.TeraGen;
25import org.apache.hadoop.examples.terasort.TeraSort;
26import org.apache.hadoop.examples.terasort.TeraValidate;
27import org.apache.hadoop.util.ProgramDriver;
28
29/**
30 * A description of an example program based on its class and a 
31 * human-readable description.
32 */
33public class ExampleDriver {
34  
35  public static void main(String argv[]){
36    int exitCode = -1;
37    ProgramDriver pgd = new ProgramDriver();
38    try {
39      pgd.addClass("wordcount", WordCount.class, 
40                   "A map/reduce program that counts the words in the input files.");
41      pgd.addClass("wordmean", WordMean.class,
42                   "A map/reduce program that counts the average length of the words in the input files.");
43      pgd.addClass("wordmedian", WordMedian.class,
44                   "A map/reduce program that counts the median length of the words in the input files.");
45      pgd.addClass("wordstandarddeviation", WordStandardDeviation.class,
46                   "A map/reduce program that counts the standard deviation of the length of the words in the input files.");
47      pgd.addClass("aggregatewordcount", AggregateWordCount.class, 
48                   "An Aggregate based map/reduce program that counts the words in the input files.");
49      pgd.addClass("aggregatewordhist", AggregateWordHistogram.class, 
50                   "An Aggregate based map/reduce program that computes the histogram of the words in the input files.");
51      pgd.addClass("grep", Grep.class, 
52                   "A map/reduce program that counts the matches of a regex in the input.");
53      pgd.addClass("randomwriter", RandomWriter.class, 
54                   "A map/reduce program that writes 10GB of random data per node.");
55      pgd.addClass("randomtextwriter", RandomTextWriter.class, 
56      "A map/reduce program that writes 10GB of random textual data per node.");
57      pgd.addClass("sort", Sort.class, "A map/reduce program that sorts the data written by the random writer.");
58
59      pgd.addClass("pi", QuasiMonteCarlo.class, QuasiMonteCarlo.DESCRIPTION);
60      pgd.addClass("bbp", BaileyBorweinPlouffe.class, BaileyBorweinPlouffe.DESCRIPTION);
61      pgd.addClass("distbbp", DistBbp.class, DistBbp.DESCRIPTION);
62
63      pgd.addClass("pentomino", DistributedPentomino.class,
64      "A map/reduce tile laying program to find solutions to pentomino problems.");
65      pgd.addClass("secondarysort", SecondarySort.class,
66                   "An example defining a secondary sort to the reduce.");
67      pgd.addClass("sudoku", Sudoku.class, "A sudoku solver.");
68      pgd.addClass("join", Join.class, "A job that effects a join over sorted, equally partitioned datasets");
69      pgd.addClass("multifilewc", MultiFileWordCount.class, "A job that counts words from several files.");
70      pgd.addClass("dbcount", DBCountPageView.class, "An example job that count the pageview counts from a database.");
71      pgd.addClass("teragen", TeraGen.class, "Generate data for the terasort");
72      pgd.addClass("terasort", TeraSort.class, "Run the terasort");
73      pgd.addClass("teravalidate", TeraValidate.class, "Checking results of terasort");
74      exitCode = pgd.run(argv);
75    }
76    catch(Throwable e){
77      e.printStackTrace();
78    }
79    
80    System.exit(exitCode);
81  }
82}
83