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

The following examples show how to use org.apache.flink.table.client.config.Environment#parse() . 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: SqlClient.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static Environment readSessionEnvironment(URL envUrl) {
	// use an empty environment by default
	if (envUrl == null) {
		System.out.println("No session environment specified.");
		return new Environment();
	}

	System.out.println("Reading session environment from: " + envUrl);
	LOG.info("Using session environment file: {}", envUrl);
	try {
		return Environment.parse(envUrl);
	} catch (IOException e) {
		throw new SqlClientException("Could not read session environment file at: " + envUrl, e);
	}
}
 
Example 2
Source File: EnvironmentFileUtil.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public static Environment parseModified(String fileName, Map<String, String> replaceVars) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	String schema = FileUtils.readFileUtf8(new File(url.getFile()));

	for (Map.Entry<String, String> replaceVar : replaceVars.entrySet()) {
		schema = schema.replace(replaceVar.getKey(), replaceVar.getValue());
	}

	return Environment.parse(schema);
}
 
Example 3
Source File: EnvironmentFileUtil.java    From pulsar-flink with Apache License 2.0 5 votes vote down vote up
public static Environment parseModified(String fileName, Map<String, String> replaceVars) throws IOException {
    final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
    Objects.requireNonNull(url);
    String schema = FileUtils.readFileUtf8(new File(url.getFile()));

    for (Map.Entry<String, String> replaceVar : replaceVars.entrySet()) {
        schema = schema.replace(replaceVar.getKey(), replaceVar.getValue());
    }

    return Environment.parse(schema);
}
 
Example 4
Source File: SqlClient.java    From flink with Apache License 2.0 5 votes vote down vote up
private static Environment readSessionEnvironment(URL envUrl) {
	// use an empty environment by default
	if (envUrl == null) {
		System.out.println("No session environment specified.");
		return new Environment();
	}

	System.out.println("Reading session environment from: " + envUrl);
	LOG.info("Using session environment file: {}", envUrl);
	try {
		return Environment.parse(envUrl);
	} catch (IOException e) {
		throw new SqlClientException("Could not read session environment file at: " + envUrl, e);
	}
}
 
Example 5
Source File: EnvironmentFileUtil.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Environment parseModified(String fileName, Map<String, String> replaceVars) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	String schema = FileUtils.readFileUtf8(new File(url.getFile()));

	for (Map.Entry<String, String> replaceVar : replaceVars.entrySet()) {
		schema = schema.replace(replaceVar.getKey(), replaceVar.getValue());
	}

	return Environment.parse(schema);
}
 
Example 6
Source File: SqlClient.java    From flink with Apache License 2.0 5 votes vote down vote up
private static Environment readSessionEnvironment(URL envUrl) {
	// use an empty environment by default
	if (envUrl == null) {
		System.out.println("No session environment specified.");
		return new Environment();
	}

	System.out.println("Reading session environment from: " + envUrl);
	LOG.info("Using session environment file: {}", envUrl);
	try {
		return Environment.parse(envUrl);
	} catch (IOException e) {
		throw new SqlClientException("Could not read session environment file at: " + envUrl, e);
	}
}
 
Example 7
Source File: EnvironmentFileUtil.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Environment parseModified(String fileName, Map<String, String> replaceVars) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	String schema = FileUtils.readFileUtf8(new File(url.getFile()));

	for (Map.Entry<String, String> replaceVar : replaceVars.entrySet()) {
		schema = schema.replace(replaceVar.getKey(), replaceVar.getValue());
	}

	return Environment.parse(schema);
}
 
Example 8
Source File: EnvironmentFileUtil.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public static Environment parseUnmodified(String fileName) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	return Environment.parse(url);
}
 
Example 9
Source File: EnvironmentFileUtil.java    From pulsar-flink with Apache License 2.0 4 votes vote down vote up
public static Environment parseUnmodified(String fileName) throws IOException {
    final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
    Objects.requireNonNull(url);
    return Environment.parse(url);
}
 
Example 10
Source File: EnvironmentFileUtil.java    From flink with Apache License 2.0 4 votes vote down vote up
public static Environment parseUnmodified(String fileName) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	return Environment.parse(url);
}
 
Example 11
Source File: EnvironmentFileUtil.java    From flink with Apache License 2.0 4 votes vote down vote up
public static Environment parseUnmodified(String fileName) throws IOException {
	final URL url = EnvironmentFileUtil.class.getClassLoader().getResource(fileName);
	Objects.requireNonNull(url);
	return Environment.parse(url);
}