当前位置: 首页>>代码示例>>Java>>正文


Java TestStreamEnvironment.unsetAsContext方法代码示例

本文整理汇总了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;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:19,代码来源:MiniClusterResource.java

示例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("-------------------------------------------------------------------------");
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:16,代码来源:KafkaTestBase.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:KafkaShortRetentionTestBase.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:ClassLoaderITCase.java

示例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();
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:CollectITCase.java

示例6: shutdownCluster

import org.apache.flink.streaming.util.TestStreamEnvironment; //导入方法依赖的package包/类
@AfterClass
public static void shutdownCluster() {
	cluster.stop();
	cluster = null;

	TestStreamEnvironment.unsetAsContext();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:TimestampITCase.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:RollingSinkSecuredITCase.java

示例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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:BigUserProgramJobSubmitITCase.java


注:本文中的org.apache.flink.streaming.util.TestStreamEnvironment.unsetAsContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。