use of org.apache.flink.api.common.RuntimeExecutionMode in project flink by apache.
the class StreamGraphGenerator method shouldExecuteInBatchMode.
private boolean shouldExecuteInBatchMode() {
final RuntimeExecutionMode configuredMode = configuration.get(ExecutionOptions.RUNTIME_MODE);
final boolean existsUnboundedSource = existsUnboundedSource();
checkState(configuredMode != RuntimeExecutionMode.BATCH || !existsUnboundedSource, "Detected an UNBOUNDED source with the '" + ExecutionOptions.RUNTIME_MODE.key() + "' set to 'BATCH'. " + "This combination is not allowed, please set the '" + ExecutionOptions.RUNTIME_MODE.key() + "' to STREAMING or AUTOMATIC");
if (checkNotNull(configuredMode) != RuntimeExecutionMode.AUTOMATIC) {
return configuredMode == RuntimeExecutionMode.BATCH;
}
return !existsUnboundedSource;
}
use of org.apache.flink.api.common.RuntimeExecutionMode in project flink by apache.
the class DefaultExecutor method createPipeline.
@Override
public Pipeline createPipeline(List<Transformation<?>> transformations, ReadableConfig tableConfiguration, @Nullable String defaultJobName) {
// reconfigure before a stream graph is generated
executionEnvironment.configure(tableConfiguration);
// create stream graph
final RuntimeExecutionMode mode = getConfiguration().get(ExecutionOptions.RUNTIME_MODE);
switch(mode) {
case BATCH:
configureBatchSpecificProperties();
break;
case STREAMING:
break;
case AUTOMATIC:
default:
throw new TableException(String.format("Unsupported runtime mode: %s", mode));
}
final StreamGraph streamGraph = executionEnvironment.generateStreamGraph(transformations);
setJobName(streamGraph, defaultJobName);
return streamGraph;
}
use of org.apache.flink.api.common.RuntimeExecutionMode in project flink by apache.
the class CLI method fromArgs.
public static CLI fromArgs(String[] args) throws Exception {
MultipleParameterTool params = MultipleParameterTool.fromArgs(args);
Path[] inputs = null;
if (params.has(INPUT_KEY)) {
inputs = params.getMultiParameterRequired(INPUT_KEY).stream().map(Path::new).toArray(Path[]::new);
} else {
System.out.println("Executing example with default input data.");
System.out.println("Use --input to specify file input.");
}
Path output = null;
if (params.has(OUTPUT_KEY)) {
output = new Path(params.get(OUTPUT_KEY));
} else {
System.out.println("Printing result to stdout. Use --output to specify output path.");
}
Duration watchInterval = null;
if (params.has(DISCOVERY_INTERVAL)) {
watchInterval = TimeUtils.parseDuration(params.get(DISCOVERY_INTERVAL));
}
RuntimeExecutionMode executionMode = ExecutionOptions.RUNTIME_MODE.defaultValue();
if (params.has(EXECUTION_MODE)) {
executionMode = RuntimeExecutionMode.valueOf(params.get(EXECUTION_MODE).toUpperCase());
}
return new CLI(inputs, output, watchInterval, executionMode, params);
}
Aggregations