Java Code Examples for org.apache.flink.table.client.config.Environment#enrich()

The following examples show how to use org.apache.flink.table.client.config.Environment#enrich() . 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: LocalExecutor.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void setSessionProperty(String sessionId, String key, String value) throws SqlExecutionException {
	ExecutionContext<?> context = getExecutionContext(sessionId);
	Environment env = context.getEnvironment();
	Environment newEnv;
	try {
		newEnv = Environment.enrich(env, Collections.singletonMap(key, value));
	} catch (Throwable t) {
		throw new SqlExecutionException("Could not set session property.", t);
	}

	// Renew the ExecutionContext by new environment.
	// Book keep all the session states of current ExecutionContext then
	// re-register them into the new one.
	ExecutionContext<?> newContext = createExecutionContextBuilder(
			context.getOriginalSessionContext())
			.env(newEnv)
			.sessionState(context.getSessionState())
			.build();
	this.contextMap.put(sessionId, newContext);
}
 
Example 2
Source File: SessionContext.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public Environment getEnvironment() {
	return Environment.enrich(
		defaultEnvironment,
		sessionProperties,
		views);
}
 
Example 3
Source File: SessionContext.java    From flink with Apache License 2.0 4 votes vote down vote up
public Environment getEnvironment() {
	return Environment.enrich(
		defaultEnvironment,
		sessionProperties,
		views);
}