Skip to content

Commit

Permalink
Make clusterStatePublished method final in ClusterStateUpdateTask
Browse files Browse the repository at this point in the history
  • Loading branch information
ywelsch committed Jun 11, 2018
1 parent 7ec662f commit 1b7eeb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public String describeTasks(List<ClusterStateUpdateTask> tasks) {
*/
public abstract void onFailure(String source, Exception e);

@Override
public final void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) {
// final, empty implementation here as this method should only be defined in combination
// with a batching executor as it will always be executed within the system context.
}

/**
* If the cluster state update task wasn't processed by the provided timeout, call
* {@link ClusterStateTaskListener#onFailure(String, Exception)}. May return null to indicate no timeout is needed (default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,6 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
latch.countDown();
}

@Override
public void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) {
assertTrue(threadPool.getThreadContext().isSystemContext());
assertEquals(Collections.emptyMap(), threadPool.getThreadContext().getHeaders());
latch.countDown();
}

@Override
protected Void newResponse(boolean acknowledged) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void onFailure(String source, Exception e) {
}

@Override
public void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) {
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
markAsDeletedLatch.countDown();
}
});
Expand Down Expand Up @@ -90,7 +90,7 @@ public void onFailure(String source, Exception e) {
}

@Override
public void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) {
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
removeJobLatch.countDown();
}
});
Expand Down

0 comments on commit 1b7eeb4

Please sign in to comment.