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

The following examples show how to use org.apache.flink.table.client.config.entries.FunctionEntry. 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
@Override
public String toString() {
	final StringBuilder sb = new StringBuilder();
	sb.append("===================== Tables =====================\n");
	tables.forEach((name, table) -> {
		sb.append("- ").append(TableEntry.TABLES_NAME).append(": ").append(name).append("\n");
		table.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Functions ====================\n");
	functions.forEach((name, function) -> {
		sb.append("- ").append(FunctionEntry.FUNCTIONS_NAME).append(": ").append(name).append("\n");
		function.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Execution ====================\n");
	execution.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	sb.append("=================== Deployment ===================\n");
	deployment.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	return sb.toString();
}
 
Example #2
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 #3
Source File: Environment.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
	final StringBuilder sb = new StringBuilder();
	sb.append("===================== Catalogs =====================\n");
	catalogs.forEach((name, catalog) -> {
		sb.append("- ").append(CatalogEntry.CATALOG_NAME).append(": ").append(name).append("\n");
		catalog.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("===================== Tables =====================\n");
	tables.forEach((name, table) -> {
		sb.append("- ").append(TableEntry.TABLES_NAME).append(": ").append(name).append("\n");
		table.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Functions ====================\n");
	functions.forEach((name, function) -> {
		sb.append("- ").append(FunctionEntry.FUNCTIONS_NAME).append(": ").append(name).append("\n");
		function.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Execution ====================\n");
	execution.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	sb.append("================== Configuration =================\n");
	configuration.asMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	sb.append("=================== Deployment ===================\n");
	deployment.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	return sb.toString();
}
 
Example #4
Source File: Environment.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public void setFunctions(List<Map<String, Object>> functions) {
	this.functions = new HashMap<>(functions.size());

	functions.forEach(config -> {
		final FunctionEntry function = FunctionEntry.create(config);
		if (this.functions.containsKey(function.getName())) {
			throw new SqlClientException(
				"Cannot create function '" + function.getName() + "' because a function with this name is already registered.");
		}
		this.functions.put(function.getName(), function);
	});
}
 
Example #5
Source File: Environment.java    From flink with Apache License 2.0 5 votes vote down vote up
public void setFunctions(List<Map<String, Object>> functions) {
	this.functions = new HashMap<>(functions.size());

	functions.forEach(config -> {
		final FunctionEntry function = FunctionEntry.create(config);
		if (this.functions.containsKey(function.getName())) {
			throw new SqlClientException(
				"Cannot create function '" + function.getName() + "' because a function with this name is already registered.");
		}
		this.functions.put(function.getName(), function);
	});
}
 
Example #6
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 #7
Source File: Environment.java    From flink with Apache License 2.0 5 votes vote down vote up
public void setFunctions(List<Map<String, Object>> functions) {
	this.functions = new HashMap<>(functions.size());

	functions.forEach(config -> {
		final FunctionEntry function = FunctionEntry.create(config);
		if (this.functions.containsKey(function.getName())) {
			throw new SqlClientException(
				"Cannot create function '" + function.getName() + "' because a function with this name is already registered.");
		}
		this.functions.put(function.getName(), function);
	});
}
 
Example #8
Source File: Environment.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	final StringBuilder sb = new StringBuilder();
	sb.append("===================== Modules =====================\n");
	modules.forEach((name, module) -> {
		sb.append("- ").append(ModuleEntry.MODULE_NAME).append(": ").append(name).append("\n");
		module.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("===================== Catalogs =====================\n");
	catalogs.forEach((name, catalog) -> {
		sb.append("- ").append(CatalogEntry.CATALOG_NAME).append(": ").append(name).append("\n");
		catalog.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("===================== Tables =====================\n");
	tables.forEach((name, table) -> {
		sb.append("- ").append(TableEntry.TABLES_NAME).append(": ").append(name).append("\n");
		table.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Functions ====================\n");
	functions.forEach((name, function) -> {
		sb.append("- ").append(FunctionEntry.FUNCTIONS_NAME).append(": ").append(name).append("\n");
		function.asMap().forEach((k, v) -> sb.append("  ").append(k).append(": ").append(v).append('\n'));
	});
	sb.append("=================== Execution ====================\n");
	execution.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	sb.append("================== Configuration =================\n");
	configuration.asMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	sb.append("=================== Deployment ===================\n");
	deployment.asTopLevelMap().forEach((k, v) -> sb.append(k).append(": ").append(v).append('\n'));
	return sb.toString();
}
 
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 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 #10
Source File: Environment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public Map<String, FunctionEntry> getFunctions() {
	return functions;
}
 
Example #11
Source File: Environment.java    From flink with Apache License 2.0 4 votes vote down vote up
public Map<String, FunctionEntry> getFunctions() {
	return functions;
}
 
Example #12
Source File: Environment.java    From flink with Apache License 2.0 4 votes vote down vote up
public Map<String, FunctionEntry> getFunctions() {
	return functions;
}