Skip to content

Commit

Permalink
[FLINK-13977] Let HighAvailabilityServices implementations implement …
Browse files Browse the repository at this point in the history
…getClusterRestEndpointLeaderElectionService

Instead of implementing HighAvailabilityServices#getWebMonitorLeaderElectionService all
HighAvailabilityServices implementation now implement getClusterRestEndpointLeaderElectionService.

This closes apache#9631.
  • Loading branch information
tillrohrmann committed Sep 6, 2019
1 parent d047c47 commit a453bf6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public class EmbeddedHaServices extends AbstractNonHaServices {

private final HashMap<JobID, EmbeddedLeaderService> jobManagerLeaderServices;

private final EmbeddedLeaderService webMonitorLeaderService;
private final EmbeddedLeaderService clusterRestEndpointLeaderService;

public EmbeddedHaServices(Executor executor) {
this.executor = Preconditions.checkNotNull(executor);
this.resourceManagerLeaderService = createEmbeddedLeaderService(executor);
this.dispatcherLeaderService = createEmbeddedLeaderService(executor);
this.jobManagerLeaderServices = new HashMap<>();
this.webMonitorLeaderService = createEmbeddedLeaderService(executor);
this.clusterRestEndpointLeaderService = createEmbeddedLeaderService(executor);
}

// ------------------------------------------------------------------------
Expand Down Expand Up @@ -103,7 +103,7 @@ public LeaderRetrievalService getJobManagerLeaderRetriever(JobID jobID, String d

@Override
public LeaderRetrievalService getClusterRestEndpointLeaderRetriever() {
return webMonitorLeaderService.createLeaderRetrievalService();
return clusterRestEndpointLeaderService.createLeaderRetrievalService();
}

@Override
Expand All @@ -118,8 +118,8 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
return webMonitorLeaderService.createLeaderElectionService();
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
return clusterRestEndpointLeaderService.createLeaderElectionService();
}

// ------------------------------------------------------------------------
Expand Down Expand Up @@ -169,7 +169,7 @@ public void close() throws Exception {

resourceManagerLeaderService.shutdown();

webMonitorLeaderService.shutdown();
clusterRestEndpointLeaderService.shutdown();
}

super.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public LeaderRetrievalService getClusterRestEndpointLeaderRetriever() {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
synchronized (lock) {
checkNotShutdown();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
return ZooKeeperUtils.createLeaderElectionService(client, configuration, REST_SERVER_LEADER_PATH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class TestingHighAvailabilityServices implements HighAvailabilityServices

private volatile LeaderElectionService dispatcherLeaderElectionService;

private volatile LeaderElectionService webMonitorEndpointLeaderElectionService;
private volatile LeaderElectionService clusterRestEndpointLeaderElectionService;

private volatile CheckpointRecoveryFactory checkpointRecoveryFactory;

Expand Down Expand Up @@ -95,8 +95,8 @@ public void setDispatcherLeaderElectionService(LeaderElectionService leaderElect
this.dispatcherLeaderElectionService = leaderElectionService;
}

public void setWebMonitorEndpointLeaderElectionService(final LeaderElectionService webMonitorEndpointLeaderElectionService) {
this.webMonitorEndpointLeaderElectionService = webMonitorEndpointLeaderElectionService;
public void setClusterRestEndpointLeaderElectionService(final LeaderElectionService clusterRestEndpointLeaderElectionService) {
this.clusterRestEndpointLeaderElectionService = clusterRestEndpointLeaderElectionService;
}

public void setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
Expand Down Expand Up @@ -197,8 +197,8 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
return webMonitorEndpointLeaderElectionService;
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
return clusterRestEndpointLeaderElectionService;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public TestingHighAvailabilityServices build() {

testingHighAvailabilityServices.setResourceManagerLeaderElectionService(resourceManagerLeaderElectionService);
testingHighAvailabilityServices.setDispatcherLeaderElectionService(dispatcherLeaderElectionService);
testingHighAvailabilityServices.setWebMonitorEndpointLeaderElectionService(webMonitorEndpointLeaderElectionService);
testingHighAvailabilityServices.setClusterRestEndpointLeaderElectionService(webMonitorEndpointLeaderElectionService);

testingHighAvailabilityServices.setCheckpointRecoveryFactory(checkpointRecoveryFactory);
testingHighAvailabilityServices.setJobGraphStore(jobGraphStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public class TestingManualHighAvailabilityServices implements HighAvailabilitySe

private final ManualLeaderService dispatcherLeaderService;

private final ManualLeaderService webMonitorEndpointLeaderService;
private final ManualLeaderService clusterRestEndpointLeaderService;

public TestingManualHighAvailabilityServices() {
jobManagerLeaderServices = new HashMap<>(4);
resourceManagerLeaderService = new ManualLeaderService();
dispatcherLeaderService = new ManualLeaderService();
webMonitorEndpointLeaderService = new ManualLeaderService();
clusterRestEndpointLeaderService = new ManualLeaderService();
}

@Override
Expand All @@ -80,7 +80,7 @@ public LeaderRetrievalService getJobManagerLeaderRetriever(JobID jobID, String d

@Override
public LeaderRetrievalService getClusterRestEndpointLeaderRetriever() {
return webMonitorEndpointLeaderService.createLeaderRetrievalService();
return clusterRestEndpointLeaderService.createLeaderRetrievalService();
}

@Override
Expand All @@ -101,8 +101,8 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
return webMonitorEndpointLeaderService.createLeaderElectionService();
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
return clusterRestEndpointLeaderService.createLeaderElectionService();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
enter();
try {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
}

@Override
public LeaderElectionService getWebMonitorLeaderElectionService() {
public LeaderElectionService getClusterRestEndpointLeaderElectionService() {
enter();
try {
throw new UnsupportedOperationException();
Expand Down

0 comments on commit a453bf6

Please sign in to comment.