Skip to content

Commit

Permalink
Revert renaming masterOperation() to clusterManagerOperation() (opens…
Browse files Browse the repository at this point in the history
…earch-project#3681)

Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng authored Jun 27, 2022
1 parent 22b42e4 commit f8aa20a
Show file tree
Hide file tree
Showing 73 changed files with 91 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected ClusterBlockException checkBlock(ClusterAllocationExplainRequest reque
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final ClusterAllocationExplainRequest request,
final ClusterState state,
final ActionListener<ClusterAllocationExplainResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected AddVotingConfigExclusionsResponse read(StreamInput in) throws IOExcept
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
AddVotingConfigExclusionsRequest request,
ClusterState state,
ActionListener<AddVotingConfigExclusionsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected ClearVotingConfigExclusionsResponse read(StreamInput in) throws IOExce
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
ClearVotingConfigExclusionsRequest request,
ClusterState initialState,
ActionListener<ClearVotingConfigExclusionsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,14 @@ protected ClusterBlockException checkBlock(ClusterHealthRequest request, Cluster
}

@Override
protected final void clusterManagerOperation(
ClusterHealthRequest request,
ClusterState state,
ActionListener<ClusterHealthResponse> listener
) throws Exception {
protected final void masterOperation(ClusterHealthRequest request, ClusterState state, ActionListener<ClusterHealthResponse> listener)
throws Exception {
logger.warn("attempt to execute a cluster health operation without a task");
throw new UnsupportedOperationException("task parameter is required for this operation");
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final Task task,
final ClusterHealthRequest request,
final ClusterState unusedState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected CleanupRepositoryResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
CleanupRepositoryRequest request,
ClusterState state,
ActionListener<CleanupRepositoryResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected ClusterBlockException checkBlock(DeleteRepositoryRequest request, Clus
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final DeleteRepositoryRequest request,
ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected ClusterBlockException checkBlock(GetRepositoriesRequest request, Clust
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final GetRepositoriesRequest request,
ClusterState state,
final ActionListener<GetRepositoriesResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected ClusterBlockException checkBlock(PutRepositoryRequest request, Cluster
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final PutRepositoryRequest request,
ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected ClusterBlockException checkBlock(VerifyRepositoryRequest request, Clus
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final VerifyRepositoryRequest request,
ClusterState state,
final ActionListener<VerifyRepositoryResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected ClusterRerouteResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final ClusterRerouteRequest request,
final ClusterState state,
final ActionListener<ClusterRerouteResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected ClusterUpdateSettingsResponse read(StreamInput in) throws IOException
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final ClusterUpdateSettingsRequest request,
final ClusterState state,
final ActionListener<ClusterUpdateSettingsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected ClusterSearchShardsResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final ClusterSearchShardsRequest request,
final ClusterState state,
final ActionListener<ClusterSearchShardsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
CloneSnapshotRequest request,
ClusterState state,
ActionListener<AcknowledgedResponse> listener
) {
protected void masterOperation(CloneSnapshotRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) {
snapshotsService.cloneSnapshot(request, ActionListener.map(listener, v -> new AcknowledgedResponse(true)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected ClusterBlockException checkBlock(CreateSnapshotRequest request, Cluste
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final CreateSnapshotRequest request,
ClusterState state,
final ActionListener<CreateSnapshotResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected ClusterBlockException checkBlock(DeleteSnapshotRequest request, Cluste
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final DeleteSnapshotRequest request,
ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected ClusterBlockException checkBlock(GetSnapshotsRequest request, ClusterS
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final GetSnapshotsRequest request,
final ClusterState state,
final ActionListener<GetSnapshotsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected ClusterBlockException checkBlock(RestoreSnapshotRequest request, Clust
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final RestoreSnapshotRequest request,
final ClusterState state,
final ActionListener<RestoreSnapshotResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected SnapshotsStatusResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final SnapshotsStatusRequest request,
final ClusterState state,
final ActionListener<SnapshotsStatusResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected ClusterBlockException checkBlock(ClusterStateRequest request, ClusterS
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final ClusterStateRequest request,
final ClusterState state,
final ActionListener<ClusterStateResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
DeleteStoredScriptRequest request,
ClusterState state,
ActionListener<AcknowledgedResponse> listener
) throws Exception {
protected void masterOperation(DeleteStoredScriptRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
throws Exception {
scriptService.deleteStoredScript(clusterService, request, listener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ protected GetStoredScriptResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
GetStoredScriptRequest request,
ClusterState state,
ActionListener<GetStoredScriptResponse> listener
) throws Exception {
protected void masterOperation(GetStoredScriptRequest request, ClusterState state, ActionListener<GetStoredScriptResponse> listener)
throws Exception {
listener.onResponse(new GetStoredScriptResponse(request.id(), scriptService.getStoredScript(state, request)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
PutStoredScriptRequest request,
ClusterState state,
ActionListener<AcknowledgedResponse> listener
) throws Exception {
protected void masterOperation(PutStoredScriptRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
throws Exception {
scriptService.putStoredScript(clusterService, request, listener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected ClusterBlockException checkBlock(PendingClusterTasksRequest request, C
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
PendingClusterTasksRequest request,
ClusterState state,
ActionListener<PendingClusterTasksResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected ClusterBlockException checkBlock(IndicesAliasesRequest request, Cluste
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final IndicesAliasesRequest request,
final ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected GetAliasesResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) {
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) {
String[] concreteIndices;
// Switch to a context which will drop any deprecation warnings, because there may be indices resolved here which are not
// returned in the final response. We'll add warnings back later if necessary in checkSystemIndexAccess.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected ClusterBlockException checkBlock(CloseIndexRequest request, ClusterSta
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final CloseIndexRequest request,
final ClusterState state,
final ActionListener<CloseIndexResponse> listener
Expand All @@ -149,7 +149,7 @@ protected void clusterManagerOperation(
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final Task task,
final CloseIndexRequest request,
final ClusterState state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ protected CreateIndexResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
CreateIndexRequest request,
ClusterState state,
ActionListener<CreateIndexResponse> finalListener
) {
protected void masterOperation(CreateIndexRequest request, ClusterState state, ActionListener<CreateIndexResponse> finalListener) {
AtomicReference<String> indexNameRef = new AtomicReference<>();
ActionListener<ClusterStateUpdateResponse> listener = ActionListener.wrap(response -> {
String indexName = indexNameRef.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected ClusterBlockException checkBlock(CreateIndexRequest request, ClusterSt
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final CreateIndexRequest request,
final ClusterState state,
final ActionListener<CreateIndexResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
DeleteDanglingIndexRequest deleteRequest,
ClusterState state,
ActionListener<AcknowledgedResponse> deleteListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
protected void masterOperation(Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
throws Exception {
CreateDataStreamClusterStateUpdateRequest updateRequest = new CreateDataStreamClusterStateUpdateRequest(
request.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected AcknowledgedResponse read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
protected void masterOperation(Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener)
throws Exception {
clusterService.submitStateUpdateTask(
"remove-data-stream [" + Strings.arrayToCommaDelimitedString(request.names) + "]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ protected Response read(StreamInput in) throws IOException {
}

@Override
protected void clusterManagerOperation(Request request, ClusterState state, ActionListener<Response> listener) throws Exception {
protected void masterOperation(Request request, ClusterState state, ActionListener<Response> listener) throws Exception {
List<DataStream> dataStreams = getDataStreams(state, indexNameExpressionResolver, request);
List<Response.DataStreamInfo> dataStreamInfos = new ArrayList<>(dataStreams.size());
for (DataStream dataStream : dataStreams) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected ClusterBlockException checkBlock(DeleteIndexRequest request, ClusterSt
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final DeleteIndexRequest request,
final ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected ClusterBlockException checkBlock(IndicesExistsRequest request, Cluster
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final IndicesExistsRequest request,
final ClusterState state,
final ActionListener<IndicesExistsResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected GetIndexResponse read(StreamInput in) throws IOException {
}

@Override
protected void doClusterManagerOperation(
protected void doMasterOperation(
final GetIndexRequest request,
String[] concreteIndices,
final ClusterState state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected GetMappingsResponse read(StreamInput in) throws IOException {
}

@Override
protected void doClusterManagerOperation(
protected void doMasterOperation(
final GetMappingsRequest request,
String[] concreteIndices,
final ClusterState state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected ClusterBlockException checkBlock(PutMappingRequest request, ClusterSta
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final PutMappingRequest request,
final ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected ClusterBlockException checkBlock(PutMappingRequest request, ClusterSta
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final PutMappingRequest request,
final ClusterState state,
final ActionListener<AcknowledgedResponse> listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected ClusterBlockException checkBlock(OpenIndexRequest request, ClusterStat
}

@Override
protected void clusterManagerOperation(
protected void masterOperation(
final OpenIndexRequest request,
final ClusterState state,
final ActionListener<OpenIndexResponse> listener
Expand Down
Loading

0 comments on commit f8aa20a

Please sign in to comment.