Java Code Examples for org.apache.flink.streaming.util.TestStreamEnvironment#unsetAsContext()

The following examples show how to use org.apache.flink.streaming.util.TestStreamEnvironment#unsetAsContext() . 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: MiniClusterWithClientResource.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public void after() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();

	Exception exception = null;

	if (clusterClient != null) {
		try {
			clusterClient.shutdown();
		} catch (Exception e) {
			exception = e;
		}
	}

	clusterClient = null;

	super.after();

	if (exception != null) {
		log.warn("Could not properly shut down the MiniClusterWithClientResource.", exception);
	}
}
 
Example 2
Source File: PulsarTestBase.java    From pulsar-flink with Apache License 2.0 6 votes vote down vote up
@AfterClass
public static void shutDownServices() throws Exception {
    log.info("-------------------------------------------------------------------------");
    log.info("    Shut down PulsarTestBase ");
    log.info("-------------------------------------------------------------------------");

    TestStreamEnvironment.unsetAsContext();

    if (pulsarService != null) {
        pulsarService.stop();
    }

    log.info("-------------------------------------------------------------------------");
    log.info("    PulsarTestBase finished");
    log.info("-------------------------------------------------------------------------");
}
 
Example 3
Source File: MiniClusterWithClientResource.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void after() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();

	Exception exception = null;

	if (clusterClient != null) {
		try {
			clusterClient.shutdown();
		} catch (Exception e) {
			exception = e;
		}
	}

	clusterClient = null;

	super.after();

	if (exception != null) {
		log.warn("Could not properly shut down the MiniClusterWithClientResource.", exception);
	}
}
 
Example 4
Source File: MiniClusterWithClientResource.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void after() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();

	Exception exception = null;

	if (clusterClient != null) {
		try {
			clusterClient.close();
		} catch (Exception e) {
			exception = e;
		}
	}

	clusterClient = null;

	super.after();

	if (exception != null) {
		log.warn("Could not properly shut down the MiniClusterWithClientResource.", exception);
	}
}
 
Example 5
Source File: KafkaTestBase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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("-------------------------------------------------------------------------");
}
 
Example 6
Source File: KafkaTestBase.java    From flink with Apache License 2.0 5 votes vote down vote up
@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("-------------------------------------------------------------------------");
}
 
Example 7
Source File: DataStreamTestEnvironment.java    From flink-spector with Apache License 2.0 5 votes vote down vote up
public DataStreamTestEnvironment(MiniCluster cluster, int parallelism) {
	super(cluster, parallelism);
	runner = new Runner(cluster) {
		@Override
		protected void executeEnvironment() throws Throwable {
			TestStreamEnvironment.setAsContext(cluster, parallelism);
			try {
				execute();
			}
			finally {
				TestStreamEnvironment.unsetAsContext();
			}
		}
	};
}
 
Example 8
Source File: DataSetTestEnvironment.java    From flink-spector with Apache License 2.0 5 votes vote down vote up
public DataSetTestEnvironment(MiniCluster executor, int parallelism) {
    super(executor, parallelism, false);
    runner = new Runner(executor) {
        @Override
        protected void executeEnvironment() throws Throwable {
            TestStreamEnvironment.setAsContext(executor, parallelism);
            try {
                execute();
            } finally {
                TestStreamEnvironment.unsetAsContext();
            }
        }
    };
}
 
Example 9
Source File: KafkaTestBase.java    From flink with Apache License 2.0 5 votes vote down vote up
@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("-------------------------------------------------------------------------");
}
 
Example 10
Source File: ClassLoaderITCase.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();
}
 
Example 11
Source File: ClassLoaderITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();
}
 
Example 12
Source File: FlinkRequiresStableInputTest.java    From beam with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void afterClass() throws Exception {
  TestStreamEnvironment.unsetAsContext();
  flinkCluster.close();
  flinkCluster = null;
}
 
Example 13
Source File: ClassLoaderITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	TestStreamEnvironment.unsetAsContext();
	TestEnvironment.unsetAsContext();
}