Skip to content

Commit

Permalink
Fixed comments related to version check and ClusterManagerNodeReadReq…
Browse files Browse the repository at this point in the history
…uest

Signed-off-by: Somesh Gupta <someshgupta987@gmail.com>
  • Loading branch information
aasom143 committed Aug 30, 2024
1 parent 5705b92 commit 6492189
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import java.io.IOException;
import java.util.Map;

import static org.opensearch.search.SearchService.NO_TIMEOUT;

/**
* A request of _cat/shards.
*
Expand All @@ -41,14 +39,6 @@ public ActionRequestValidationException validate() {
return null;
}

public void setLocal(boolean local) {
this.local = local;
}

public boolean getLocal() {
return this.local;
}

public void setIndices(String[] indices) {
this.indices = indices;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public TransportCatShardsAction(NodeClient client, TransportService transportSer
public void doExecute(Task parentTask, CatShardsRequest shardsRequest, ActionListener<CatShardsResponse> listener) {
final ClusterStateRequest clusterStateRequest = new ClusterStateRequest();
clusterStateRequest.setShouldCancelOnTimeout(true);
clusterStateRequest.local(shardsRequest.getLocal());
clusterStateRequest.local(shardsRequest.local());
clusterStateRequest.clusterManagerNodeTimeout(shardsRequest.clusterManagerNodeTimeout());
clusterStateRequest.clear().nodes(true).routingTable(true).indices(shardsRequest.getIndices());
assert parentTask instanceof CancellableTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public BroadcastRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
shouldCancelOnTimeout = in.readBoolean();
}

protected BroadcastRequest(String... indices) {
Expand Down Expand Up @@ -126,7 +125,6 @@ public boolean includeDataStreams() {
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeStringArrayNullable(indices);
out.writeBoolean(shouldCancelOnTimeout);
indicesOptions.writeIndicesOptions(out);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ protected ClusterManagerNodeReadRequest() {}
protected ClusterManagerNodeReadRequest(StreamInput in) throws IOException {
super(in);
local = in.readBoolean();
shouldCancelOnTimeout = in.readBoolean();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(local);
out.writeBoolean(shouldCancelOnTimeout);
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ protected void documentation(StringBuilder sb) {
public RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) {
final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
final CatShardsRequest shardsRequest = new CatShardsRequest();
shardsRequest.setLocal(request.paramAsBoolean("local", shardsRequest.local()));
shardsRequest.clusterManagerNodeTimeout(
request.paramAsTime("cluster_manager_timeout", shardsRequest.clusterManagerNodeTimeout())
);
shardsRequest.local(request.paramAsBoolean("local", shardsRequest.local()));
shardsRequest.clusterManagerNodeTimeout(request.paramAsTime("cluster_manager_timeout", shardsRequest.clusterManagerNodeTimeout()));
shardsRequest.setCancelAfterTimeInterval(request.paramAsTime("cancel_after_time_interval", NO_TIMEOUT));
shardsRequest.setIndices(indices);
parseDeprecatedMasterTimeoutParameter(shardsRequest, request, deprecationLogger, getName());
Expand Down

0 comments on commit 6492189

Please sign in to comment.