@Experimental public class MiniClusterTestEnvironment extends Object implements TestEnvironment, ClusterControllable
Constructor and Description |
---|
MiniClusterTestEnvironment() |
Modifier and Type | Method and Description |
---|---|
StreamExecutionEnvironment |
createExecutionEnvironment()
Create a new
StreamExecutionEnvironment for configuring and executing the Flink job. |
void |
isolateNetwork(JobClient jobClient,
Runnable afterFailAction) |
void |
startUp()
Start up the test resource.
|
void |
tearDown()
Tear down the test resource.
|
String |
toString() |
void |
triggerJobManagerFailover(JobClient jobClient,
Runnable afterFailAction) |
void |
triggerTaskManagerFailover(JobClient jobClient,
Runnable afterFailAction) |
public StreamExecutionEnvironment createExecutionEnvironment()
TestEnvironment
StreamExecutionEnvironment
for configuring and executing the Flink job.createExecutionEnvironment
in interface TestEnvironment
public void triggerJobManagerFailover(JobClient jobClient, Runnable afterFailAction) throws ExecutionException, InterruptedException
triggerJobManagerFailover
in interface ClusterControllable
ExecutionException
InterruptedException
public void triggerTaskManagerFailover(JobClient jobClient, Runnable afterFailAction) throws Exception
triggerTaskManagerFailover
in interface ClusterControllable
Exception
public void isolateNetwork(JobClient jobClient, Runnable afterFailAction)
isolateNetwork
in interface ClusterControllable
public void startUp() throws Exception
TestResource
The implementation of this method should be idempotent.
startUp
in interface TestResource
Exception
- if anything wrong when starting the resourcepublic void tearDown()
TestResource
The test resource should be able to tear down even without a startup (could be a no-op).
tearDown
in interface TestResource
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.