Java Code Examples for org.apache.flink.api.java.utils.ParameterTool#getConfiguration()

The following examples show how to use org.apache.flink.api.java.utils.ParameterTool#getConfiguration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DispatcherProcess.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Entrypoint of the DispatcherProcessEntryPoint.
 *
 * <p>Other arguments are parsed to a {@link Configuration} and passed to the Dispatcher,
 * for instance: <code>--high-availability ZOOKEEPER --high-availability.zookeeper.quorum
 * "xyz:123:456"</code>.
 */
public static void main(String[] args) {
	try {
		ParameterTool params = ParameterTool.fromArgs(args);
		Configuration config = params.getConfiguration();
		LOG.info("Configuration: {}.", config);

		config.setInteger(JobManagerOptions.PORT, 0);
		config.setString(RestOptions.BIND_PORT, "0");

		final StandaloneSessionClusterEntrypoint clusterEntrypoint = new StandaloneSessionClusterEntrypoint(config);

		ClusterEntrypoint.runClusterEntrypoint(clusterEntrypoint);
	}
	catch (Throwable t) {
		LOG.error("Failed to start Dispatcher process", t);
		System.exit(1);
	}
}
 
Example 2
Source File: DispatcherProcess.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Entrypoint of the DispatcherProcessEntryPoint.
 *
 * <p>Other arguments are parsed to a {@link Configuration} and passed to the Dispatcher,
 * for instance: <code>--high-availability ZOOKEEPER --high-availability.zookeeper.quorum
 * "xyz:123:456"</code>.
 */
public static void main(String[] args) {
	try {
		ParameterTool params = ParameterTool.fromArgs(args);
		Configuration config = params.getConfiguration();
		LOG.info("Configuration: {}.", config);

		config.setInteger(JobManagerOptions.PORT, 0);
		config.setString(RestOptions.BIND_PORT, "0");

		final StandaloneSessionClusterEntrypoint clusterEntrypoint = new StandaloneSessionClusterEntrypoint(config);

		ClusterEntrypoint.runClusterEntrypoint(clusterEntrypoint);
	}
	catch (Throwable t) {
		LOG.error("Failed to start Dispatcher process", t);
		System.exit(1);
	}
}
 
Example 3
Source File: DispatcherProcess.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Entrypoint of the DispatcherProcessEntryPoint.
 *
 * <p>Other arguments are parsed to a {@link Configuration} and passed to the Dispatcher,
 * for instance: <code>--high-availability ZOOKEEPER --high-availability.zookeeper.quorum
 * "xyz:123:456"</code>.
 */
public static void main(String[] args) {
	try {
		ParameterTool params = ParameterTool.fromArgs(args);
		Configuration config = params.getConfiguration();
		LOG.info("Configuration: {}.", config);

		config.setInteger(JobManagerOptions.PORT, 0);
		config.setString(RestOptions.BIND_PORT, "0");

		final StandaloneSessionClusterEntrypoint clusterEntrypoint = new StandaloneSessionClusterEntrypoint(config);

		ClusterEntrypoint.runClusterEntrypoint(clusterEntrypoint);
	}
	catch (Throwable t) {
		LOG.error("Failed to start Dispatcher process", t);
		System.exit(1);
	}
}
 
Example 4
Source File: AbstractTaskManagerProcessFailureRecoveryTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
	try {
		final ParameterTool parameterTool = ParameterTool.fromArgs(args);
		Configuration cfg = parameterTool.getConfiguration();

		TaskManagerRunner.runTaskManager(cfg, ResourceID.generate());
	}
	catch (Throwable t) {
		LOG.error("Failed to start TaskManager process", t);
		System.exit(1);
	}
}
 
Example 5
Source File: AbstractTaskManagerProcessFailureRecoveryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
	try {
		final ParameterTool parameterTool = ParameterTool.fromArgs(args);
		Configuration cfg = parameterTool.getConfiguration();

		TaskManagerRunner.runTaskManager(cfg, ResourceID.generate());
	}
	catch (Throwable t) {
		LOG.error("Failed to start TaskManager process", t);
		System.exit(1);
	}
}
 
Example 6
Source File: AbstractTaskManagerProcessFailureRecoveryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
	try {
		final ParameterTool parameterTool = ParameterTool.fromArgs(args);
		Configuration cfg = parameterTool.getConfiguration();
		final PluginManager pluginManager = PluginUtils.createPluginManagerFromRootFolder(cfg);

		TaskManagerRunner.runTaskManager(cfg, pluginManager);
	}
	catch (Throwable t) {
		LOG.error("Failed to start TaskManager process", t);
		System.exit(1);
	}
}
 
Example 7
Source File: StatefulFunctionsJob.java    From stateful-functions with Apache License 2.0 4 votes vote down vote up
public static void main(String... args) throws Exception {
  ParameterTool parameterTool = ParameterTool.fromArgs(args);
  Configuration configuration = parameterTool.getConfiguration();

  main(configuration);
}