private void setupOptions()

in odps-sdk-impl/odps-mapred-bridge/src/main/java/com/aliyun/odps/mapred/bridge/streaming/StreamJob.java [381:470]


  private void setupOptions() {

    // input and output are not required for -info and -help options,
    // though they are required for streaming job to be run.
    Option input = createOption("input",
                                "Input tables/partitions for the Map step",
                                "path",
                                Integer.MAX_VALUE,
                                false);

    Option columns = createOption("columns",
                                  "Input table column names for the Map step",
                                  "spec",
                                  1,
                                  false);

    Option output = createOption("output",
                                 "Result table/partition for the Reduce step",
                                 "path", 1, false);
    Option mapper = createOption("mapper",
                                 "The streaming command to run", "cmd", 1, false);
    Option combiner = createOption("combiner",
                                   "The streaming command to run", "cmd", 1, false);
    // reducer could be NONE
    Option reducer = createOption("reducer",
                                  "The streaming command to run", "cmd", 1, false);
    Option file = createOption("file",
                               "File to be shipped in the Job jar file",
                               "file", Integer.MAX_VALUE, false);
    Option additionalconfspec = createOption("additionalconfspec",
                                             "Optional.", "spec", 1, false);
    Option partitioner = createOption("partitioner",
                                      "Optional.", "spec", 1, false);
    Option numReduceTasks = createOption("numReduceTasks",
                                         "Optional.", "spec", 1, false);
    Option mapDebug = createOption("mapdebug",
                                   "Optional.", "spec", 1, false);
    Option reduceDebug = createOption("reducedebug",
                                      "Optional", "spec", 1, false);
    Option jobconf =
        createOption("jobconf",
                     "(n=v) Optional. Add or override a JobConf property.",
                     "spec", 1, false);

    Option cmdenv =
        createOption("cmdenv", "(n=v) Pass env.var to streaming commands.",
                     "spec", 1, false);
    Option cacheFile = createOption("cacheFile",
                                    "File name URI", "fileNameURI", Integer.MAX_VALUE, false);
    Option cacheArchive = createOption("cacheArchive",
                                       "File name URI", "fileNameURI", Integer.MAX_VALUE, false);
    Option io = createOption("io",
                             "Optional.", "spec", 1, false);

    // boolean properties

    Option
        background =
        createBoolOption("background", "Submit the job and don't wait till it completes.");
    Option verbose = createBoolOption("verbose", "print verbose output");
    Option info = createBoolOption("info", "print verbose output");
    Option help = createBoolOption("help", "print this help message");
    Option debug = createBoolOption("debug", "print debug output");
    Option lazyOutput = createBoolOption("lazyOutput", "create outputs lazily");

    allOptions = new Options().
        addOption(input).
        addOption(columns).
        addOption(output).
        addOption(mapper).
        addOption(combiner).
        addOption(reducer).
        addOption(file).
        addOption(additionalconfspec).
        addOption(partitioner).
        addOption(numReduceTasks).
        addOption(mapDebug).
        addOption(reduceDebug).
        addOption(jobconf).
        addOption(cmdenv).
        addOption(cacheFile).
        addOption(cacheArchive).
        addOption(io).
        addOption(background).
        addOption(verbose).
        addOption(info).
        addOption(debug).
        addOption(help).
        addOption(lazyOutput);
  }