本文整理汇总了Java中org.apache.flink.streaming.util.TestStreamEnvironment.unsetAsContext方法的典型用法代码示例。如果您正苦于以下问题:Java TestStreamEnvironment.unsetAsContext方法的具体用法?Java TestStreamEnvironment.unsetAsContext怎么用?Java TestStreamEnvironment.unsetAsContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.streaming.util.TestStreamEnvironment
的用法示例。
在下文中一共展示了TestStreamEnvironment.unsetAsContext方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: after
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@Override
public void after() {
TestStreamEnvironment.unsetAsContext();
TestEnvironment.unsetAsContext();
final CompletableFuture<?> terminationFuture = jobExecutorService.terminate();
try {
terminationFuture.get(
miniClusterResourceConfiguration.getShutdownTimeout().toMilliseconds(),
TimeUnit.MILLISECONDS);
} catch (Exception e) {
LOG.warn("Could not properly shut down the MiniClusterResource.", e);
}
jobExecutorService = null;
}
示例2: shutDownServices
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void shutDownServices() throws Exception {
LOG.info("-------------------------------------------------------------------------");
LOG.info(" Shut down KafkaTestBase ");
LOG.info("-------------------------------------------------------------------------");
TestStreamEnvironment.unsetAsContext();
shutdownClusters();
LOG.info("-------------------------------------------------------------------------");
LOG.info(" KafkaTestBase finished");
LOG.info("-------------------------------------------------------------------------");
}
示例3: shutDownServices
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void shutDownServices() throws Exception {
TestStreamEnvironment.unsetAsContext();
if (flink != null) {
flink.stop();
}
kafkaServer.shutdown();
secureProps.clear();
}
示例4: tearDown
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void tearDown() throws Exception {
if (testCluster != null) {
testCluster.stop();
}
TestStreamEnvironment.unsetAsContext();
TestEnvironment.unsetAsContext();
}
示例5: testCollect
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@Test
public void testCollect() throws Exception {
final LocalFlinkMiniCluster cluster = new LocalFlinkMiniCluster(new Configuration(), false);
try {
cluster.start();
TestStreamEnvironment.setAsContext(cluster, 1);
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
final long n = 10;
DataStream<Long> stream = env.generateSequence(1, n);
long i = 1;
for (Iterator<Long> it = DataStreamUtils.collect(stream); it.hasNext(); ) {
long x = it.next();
assertEquals("received wrong element", i, x);
i++;
}
assertEquals("received wrong number of elements", n + 1, i);
}
finally {
TestStreamEnvironment.unsetAsContext();
cluster.stop();
}
}
示例6: shutdownCluster
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void shutdownCluster() {
cluster.stop();
cluster = null;
TestStreamEnvironment.unsetAsContext();
}
示例7: teardownSecureCluster
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void teardownSecureCluster() throws Exception {
LOG.info("tearing down secure cluster environment");
TestStreamEnvironment.unsetAsContext();
stopCluster(cluster, TestBaseUtils.DEFAULT_TIMEOUT);
if (hdfsCluster != null) {
hdfsCluster.shutdown();
}
SecureTestEnvironment.cleanup();
}
示例8: teardown
import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void teardown() throws Exception {
LOG.info("Closing FlinkMiniCluster");
TestStreamEnvironment.unsetAsContext();
TestBaseUtils.stopCluster(cluster, TestBaseUtils.DEFAULT_TIMEOUT);
}