Java Code Examples for org.apache.flink.table.client.gateway.SessionContext#setSessionProperty()
The following examples show how to use
org.apache.flink.table.client.gateway.SessionContext#setSessionProperty() .
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: LocalExecutorITCase.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testGetSessionProperties() throws Exception { final Executor executor = createDefaultExecutor(clusterClient); final SessionContext session = new SessionContext("test-session", new Environment()); session.setSessionProperty("execution.result-mode", "changelog"); executor.getSessionProperties(session); // modify defaults session.setSessionProperty("execution.result-mode", "table"); final Map<String, String> actualProperties = executor.getSessionProperties(session); final Map<String, String> expectedProperties = new HashMap<>(); expectedProperties.put("execution.type", "batch"); expectedProperties.put("execution.time-characteristic", "event-time"); expectedProperties.put("execution.periodic-watermarks-interval", "99"); expectedProperties.put("execution.parallelism", "1"); expectedProperties.put("execution.max-parallelism", "16"); expectedProperties.put("execution.max-idle-state-retention", "0"); expectedProperties.put("execution.min-idle-state-retention", "0"); expectedProperties.put("execution.result-mode", "table"); expectedProperties.put("execution.max-table-result-rows", "100"); expectedProperties.put("execution.restart-strategy.type", "failure-rate"); expectedProperties.put("execution.restart-strategy.max-failures-per-interval", "10"); expectedProperties.put("execution.restart-strategy.failure-rate-interval", "99000"); expectedProperties.put("execution.restart-strategy.delay", "1000"); expectedProperties.put("deployment.response-timeout", "5000"); assertEquals(expectedProperties, actualProperties); }
Example 2
Source File: LocalExecutorITCase.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGetSessionProperties() throws Exception { final Executor executor = createDefaultExecutor(clusterClient); final SessionContext session = new SessionContext("test-session", new Environment()); session.setSessionProperty("execution.result-mode", "changelog"); executor.getSessionProperties(session); // modify defaults session.setSessionProperty("execution.result-mode", "table"); final Map<String, String> actualProperties = executor.getSessionProperties(session); final Map<String, String> expectedProperties = new HashMap<>(); expectedProperties.put("execution.planner", planner); expectedProperties.put("execution.type", "batch"); expectedProperties.put("execution.time-characteristic", "event-time"); expectedProperties.put("execution.periodic-watermarks-interval", "99"); expectedProperties.put("execution.parallelism", "1"); expectedProperties.put("execution.max-parallelism", "16"); expectedProperties.put("execution.max-idle-state-retention", "0"); expectedProperties.put("execution.min-idle-state-retention", "0"); expectedProperties.put("execution.result-mode", "table"); expectedProperties.put("execution.max-table-result-rows", "100"); expectedProperties.put("execution.restart-strategy.type", "failure-rate"); expectedProperties.put("execution.restart-strategy.max-failures-per-interval", "10"); expectedProperties.put("execution.restart-strategy.failure-rate-interval", "99000"); expectedProperties.put("execution.restart-strategy.delay", "1000"); expectedProperties.put("table.optimizer.join-reorder-enabled", "false"); expectedProperties.put("deployment.response-timeout", "5000"); assertEquals(expectedProperties, actualProperties); }