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

The following examples show how to use org.apache.flink.table.client.config.entries.DeploymentEntry. 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: Environment.java    From Flink-CEPplus with 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 File: Environment.java    From Flink-CEPplus with 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 File: Environment.java    From flink with 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 #4
Source File: Environment.java    From flink with 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 #5
Source File: ExecutionContext.java    From flink with 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 #6
Source File: Environment.java    From flink with 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 #7
Source File: Environment.java    From flink with 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 #8
Source File: ExecutionContext.java    From Flink-CEPplus with 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 File: Environment.java    From flink with 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 #10
Source File: Environment.java    From flink with 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 #11
Source File: ExecutionContext.java    From flink with 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 #12
Source File: Environment.java    From flink with Apache License 2.0 4 votes vote down vote up
public void setDeployment(Map<String, Object> config) {
	this.deployment = DeploymentEntry.create(config);
}
 
Example #13
Source File: Environment.java    From flink with Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}
 
Example #14
Source File: Environment.java    From flink with 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 File: ResultStore.java    From flink with 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 #16
Source File: Environment.java    From flink with Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}
 
Example #17
Source File: ResultStore.java    From flink with 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 #18
Source File: Environment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public DeploymentEntry getDeployment() {
	return deployment;
}
 
Example #19
Source File: Environment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public void setDeployment(Map<String, Object> config) {
	this.deployment = DeploymentEntry.create(config);
}
 
Example #20
Source File: Environment.java    From Flink-CEPplus with 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 #21
Source File: ResultStore.java    From Flink-CEPplus with 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();
}