use of org.apache.flink.runtime.highavailability.nonha.embedded.HaLeadershipControl in project flink by apache.
the class FileSourceTextLinesITCase method triggerJobManagerFailover.
private static void triggerJobManagerFailover(JobID jobId, Runnable afterFailAction, MiniCluster miniCluster) throws Exception {
final HaLeadershipControl haLeadershipControl = miniCluster.getHaLeadershipControl().get();
haLeadershipControl.revokeJobMasterLeadership(jobId).get();
afterFailAction.run();
haLeadershipControl.grantJobMasterLeadership(jobId).get();
}
use of org.apache.flink.runtime.highavailability.nonha.embedded.HaLeadershipControl in project flink by apache.
the class HybridSourceITCase method triggerJobManagerFailover.
private static void triggerJobManagerFailover(JobID jobId, Runnable afterFailAction, MiniCluster miniCluster) throws Exception {
final HaLeadershipControl haLeadershipControl = miniCluster.getHaLeadershipControl().get();
haLeadershipControl.revokeJobMasterLeadership(jobId).get();
afterFailAction.run();
haLeadershipControl.grantJobMasterLeadership(jobId).get();
}
use of org.apache.flink.runtime.highavailability.nonha.embedded.HaLeadershipControl in project flink by apache.
the class MiniClusterTestEnvironment method triggerJobManagerFailover.
@Override
public void triggerJobManagerFailover(JobClient jobClient, Runnable afterFailAction) throws ExecutionException, InterruptedException {
final Optional<HaLeadershipControl> controlOptional = miniCluster.getMiniCluster().getHaLeadershipControl();
if (!controlOptional.isPresent()) {
throw new UnsupportedOperationException("This MiniCluster does not support JobManager HA");
}
final HaLeadershipControl haLeadershipControl = controlOptional.get();
haLeadershipControl.revokeJobMasterLeadership(jobClient.getJobID()).get();
afterFailAction.run();
haLeadershipControl.grantJobMasterLeadership(jobClient.getJobID()).get();
}
Aggregations