Search in sources :

Example 1 with Output

use of org.apache.flink.graph.drivers.output.Output in project flink by apache.

the class Runner method getAlgorithmUsage.

/**
 * Display the usage for the given algorithm. This includes options for all compatible inputs,
 * the selected algorithm, and outputs implemented by the selected algorithm.
 *
 * @param algorithmName unique identifier of the selected algorithm
 * @return usage string for the given algorithm
 */
private static String getAlgorithmUsage(String algorithmName) {
    StrBuilder strBuilder = new StrBuilder();
    Driver algorithm = driverFactory.get(algorithmName);
    strBuilder.appendNewLine().appendNewLine().appendln(algorithm.getLongDescription()).appendNewLine().append("usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm ").append(algorithmName).append(" [algorithm options] --input <input> [input options] --output <output> [output options]").appendNewLine().appendNewLine().appendln("Available inputs:");
    for (Input input : inputFactory) {
        strBuilder.append("  --input ").append(input.getName()).append(" ").appendln(input.getUsage());
    }
    String algorithmParameterization = algorithm.getUsage();
    if (algorithmParameterization.length() > 0) {
        strBuilder.appendNewLine().appendln("Algorithm configuration:").append("  ").appendln(algorithm.getUsage());
    }
    strBuilder.appendNewLine().appendln("Available outputs:");
    for (Output output : outputFactory) {
        strBuilder.append("  --output ").append(output.getName()).append(" ").appendln(output.getUsage());
    }
    return strBuilder.appendNewLine().toString();
}
Also used : Input(org.apache.flink.graph.drivers.input.Input) Output(org.apache.flink.graph.drivers.output.Output) Driver(org.apache.flink.graph.drivers.Driver) StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Aggregations

StrBuilder (org.apache.commons.lang3.text.StrBuilder)1 Driver (org.apache.flink.graph.drivers.Driver)1 Input (org.apache.flink.graph.drivers.input.Input)1 Output (org.apache.flink.graph.drivers.output.Output)1