Java Code Examples for org.apache.flink.table.client.config.entries.DeploymentEntry

The following examples show how to use org.apache.flink.table.client.config.entries.DeploymentEntry. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: Environment.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Merges two environments. The properties of the first environment might be overwritten by the second one.
 */
public static Environment merge(Environment env1, Environment env2) {
	final Environment mergedEnv = new Environment();

	// merge tables
	final Map<String, TableEntry> tables = new LinkedHashMap<>(env1.getTables());
	tables.putAll(env2.getTables());
	mergedEnv.tables = tables;

	// merge functions
	final Map<String, FunctionEntry> functions = new HashMap<>(env1.getFunctions());
	functions.putAll(env2.getFunctions());
	mergedEnv.functions = functions;

	// merge execution properties
	mergedEnv.execution = ExecutionEntry.merge(env1.getExecution(), env2.getExecution());

	// merge deployment properties
	mergedEnv.deployment = DeploymentEntry.merge(env1.getDeployment(), env2.getDeployment());

	return mergedEnv;
}
 
Example 2
Source Project: Flink-CEPplus   Source File: Environment.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Enriches an environment with new/modified properties or views and returns the new instance.
 */
public static Environment enrich(
		Environment env,
		Map<String, String> properties,
		Map<String, ViewEntry> views) {
	final Environment enrichedEnv = new Environment();

	// merge tables
	enrichedEnv.tables = new LinkedHashMap<>(env.getTables());
	enrichedEnv.tables.putAll(views);

	// merge functions
	enrichedEnv.functions = new HashMap<>(env.getFunctions());

	// enrich execution properties
	enrichedEnv.execution = ExecutionEntry.enrich(env.execution, properties);

	// enrich deployment properties
	enrichedEnv.deployment = DeploymentEntry.enrich(env.deployment, properties);

	return enrichedEnv;
}
 
Example 3
Source Project: Flink-CEPplus   Source File: ExecutionContext.java    License: Apache License 2.0 5 votes vote down vote up
private static CommandLine createCommandLine(DeploymentEntry deployment, Options commandLineOptions) {
	try {
		return deployment.getCommandLine(commandLineOptions);
	} catch (Exception e) {
		throw new SqlExecutionException("Invalid deployment options.", e);
	}
}
 
Example 4
Source Project: flink   Source File: ExecutionContext.java    License: Apache License 2.0 5 votes vote down vote up
private static CommandLine createCommandLine(DeploymentEntry deployment, Options commandLineOptions) {
	try {
		return deployment.getCommandLine(commandLineOptions);
	} catch (Exception e) {
		throw new SqlExecutionException("Invalid deployment options.", e);
	}
}
 
Example 5
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
public Environment() {
	this.catalogs = Collections.emptyMap();
	this.tables = Collections.emptyMap();
	this.functions = Collections.emptyMap();
	this.execution = ExecutionEntry.DEFAULT_INSTANCE;
	this.configuration = ConfigurationEntry.DEFAULT_INSTANCE;
	this.deployment = DeploymentEntry.DEFAULT_INSTANCE;
}
 
Example 6
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Merges two environments. The properties of the first environment might be overwritten by the second one.
 */
public static Environment merge(Environment env1, Environment env2) {
	final Environment mergedEnv = new Environment();

	// merge catalogs
	final Map<String, CatalogEntry> catalogs = new HashMap<>(env1.getCatalogs());
	catalogs.putAll(env2.getCatalogs());
	mergedEnv.catalogs = catalogs;

	// merge tables
	final Map<String, TableEntry> tables = new LinkedHashMap<>(env1.getTables());
	tables.putAll(env2.getTables());
	mergedEnv.tables = tables;

	// merge functions
	final Map<String, FunctionEntry> functions = new HashMap<>(env1.getFunctions());
	functions.putAll(env2.getFunctions());
	mergedEnv.functions = functions;

	// merge execution properties
	mergedEnv.execution = ExecutionEntry.merge(env1.getExecution(), env2.getExecution());

	// merge configuration properties
	mergedEnv.configuration = ConfigurationEntry.merge(env1.getConfiguration(), env2.getConfiguration());

	// merge deployment properties
	mergedEnv.deployment = DeploymentEntry.merge(env1.getDeployment(), env2.getDeployment());

	return mergedEnv;
}
 
Example 7
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Enriches an environment with new/modified properties or views and returns the new instance.
 */
public static Environment enrich(
		Environment env,
		Map<String, String> properties,
		Map<String, ViewEntry> views) {
	final Environment enrichedEnv = new Environment();

	// merge catalogs
	enrichedEnv.catalogs = new LinkedHashMap<>(env.getCatalogs());

	// merge tables
	enrichedEnv.tables = new LinkedHashMap<>(env.getTables());
	enrichedEnv.tables.putAll(views);

	// merge functions
	enrichedEnv.functions = new HashMap<>(env.getFunctions());

	// enrich execution properties
	enrichedEnv.execution = ExecutionEntry.enrich(env.execution, properties);

	// enrich configuration properties
	enrichedEnv.configuration = ConfigurationEntry.enrich(env.configuration, properties);

	// enrich deployment properties
	enrichedEnv.deployment = DeploymentEntry.enrich(env.deployment, properties);

	return enrichedEnv;
}
 
Example 8
Source Project: flink   Source File: ExecutionContext.java    License: Apache License 2.0 5 votes vote down vote up
private static CommandLine createCommandLine(DeploymentEntry deployment, Options commandLineOptions) {
	try {
		return deployment.getCommandLine(commandLineOptions);
	} catch (Exception e) {
		throw new SqlExecutionException("Invalid deployment options.", e);
	}
}
 
Example 9
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
public Environment() {
	this.modules = new LinkedHashMap<>();
	this.catalogs = Collections.emptyMap();
	this.tables = Collections.emptyMap();
	this.functions = Collections.emptyMap();
	this.execution = ExecutionEntry.DEFAULT_INSTANCE;
	this.configuration = ConfigurationEntry.DEFAULT_INSTANCE;
	this.deployment = DeploymentEntry.DEFAULT_INSTANCE;
}
 
Example 10
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Merges two environments. The properties of the first environment might be overwritten by the second one.
 */
public static Environment merge(Environment env1, Environment env2) {
	final Environment mergedEnv = new Environment();

	// merge modules
	final Map<String, ModuleEntry> modules = new LinkedHashMap<>(env1.getModules());
	modules.putAll(env2.getModules());
	mergedEnv.modules = modules;

	// merge catalogs
	final Map<String, CatalogEntry> catalogs = new HashMap<>(env1.getCatalogs());
	catalogs.putAll(env2.getCatalogs());
	mergedEnv.catalogs = catalogs;

	// merge tables
	final Map<String, TableEntry> tables = new LinkedHashMap<>(env1.getTables());
	tables.putAll(env2.getTables());
	mergedEnv.tables = tables;

	// merge functions
	final Map<String, FunctionEntry> functions = new HashMap<>(env1.getFunctions());
	functions.putAll(env2.getFunctions());
	mergedEnv.functions = functions;

	// merge execution properties
	mergedEnv.execution = ExecutionEntry.merge(env1.getExecution(), env2.getExecution());

	// merge configuration properties
	mergedEnv.configuration = ConfigurationEntry.merge(env1.getConfiguration(), env2.getConfiguration());

	// merge deployment properties
	mergedEnv.deployment = DeploymentEntry.merge(env1.getDeployment(), env2.getDeployment());

	return mergedEnv;
}
 
Example 11
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Enriches an environment with new/modified properties and returns the new instance.
 */
public static Environment enrich(Environment env, Map<String, String> properties) {
	final Environment enrichedEnv = new Environment();

	// copy modules
	enrichedEnv.modules = new LinkedHashMap<>(env.getModules());

	// copy catalogs
	enrichedEnv.catalogs = new LinkedHashMap<>(env.getCatalogs());

	// copy tables
	enrichedEnv.tables = new LinkedHashMap<>(env.getTables());

	// copy functions
	enrichedEnv.functions = new HashMap<>(env.getFunctions());

	// enrich execution properties
	enrichedEnv.execution = ExecutionEntry.enrich(env.execution, properties);

	// enrich configuration properties
	enrichedEnv.configuration = ConfigurationEntry.enrich(env.configuration, properties);

	// enrich deployment properties
	enrichedEnv.deployment = DeploymentEntry.enrich(env.deployment, properties);

	return enrichedEnv;
}
 
Example 12
Source Project: Flink-CEPplus   Source File: ResultStore.java    License: Apache License 2.0 4 votes vote down vote up
private int getGatewayPort(DeploymentEntry deploy) {
	// try to get address from deployment configuration
	return deploy.getGatewayPort();
}
 
Example 13
Source Project: Flink-CEPplus   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public Environment() {
	this.tables = Collections.emptyMap();
	this.functions = Collections.emptyMap();
	this.execution = ExecutionEntry.DEFAULT_INSTANCE;
	this.deployment = DeploymentEntry.DEFAULT_INSTANCE;
}
 
Example 14
Source Project: Flink-CEPplus   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public void setDeployment(Map<String, Object> config) {
	this.deployment = DeploymentEntry.create(config);
}
 
Example 15
Source Project: Flink-CEPplus   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}
 
Example 16
Source Project: flink   Source File: ResultStore.java    License: Apache License 2.0 4 votes vote down vote up
private int getGatewayPort(DeploymentEntry deploy) {
	// try to get address from deployment configuration
	return deploy.getGatewayPort();
}
 
Example 17
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public void setDeployment(Map<String, Object> config) {
	this.deployment = DeploymentEntry.create(config);
}
 
Example 18
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}
 
Example 19
Source Project: flink   Source File: ResultStore.java    License: Apache License 2.0 4 votes vote down vote up
private int getGatewayPort(DeploymentEntry deploy) {
	// try to get address from deployment configuration
	return deploy.getGatewayPort();
}
 
Example 20
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public void setDeployment(Map<String, Object> config) {
	this.deployment = DeploymentEntry.create(config);
}
 
Example 21
Source Project: flink   Source File: Environment.java    License: Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}