Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed May 29, 2020
1 parent f15106e commit fb3007c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ static Request explain(ExplainRequest explainRequest) throws IOException {
}

static Request fieldCaps(FieldCapabilitiesRequest fieldCapabilitiesRequest) throws IOException {
String methodName = fieldCapabilitiesRequest.indexFilter() != null ? HttpPut.METHOD_NAME : HttpGet.METHOD_NAME;
String methodName = fieldCapabilitiesRequest.indexFilter() != null ? HttpPost.METHOD_NAME : HttpGet.METHOD_NAME;
Request request = new Request(methodName, endpoint(fieldCapabilitiesRequest.indices(), "_field_caps"));

Params params = new Params();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@
bulk:
refresh: true
body:
- '{"index": {"_index": "field_caps_index_1"}}'
# Force all documents to be in the same shard (same routing)
- '{"index": {"_index": "field_caps_index_1", "_routing": "foo" }'
- '{"created_at": "2018-01-05"}'
- '{"index": {"_index": "field_caps_index_1"}}'
- '{"index": {"_index": "field_caps_index_1", "_routing": "foo"}'
- '{"created_at": "2017-12-01"}'
- '{"index": {"_index": "field_caps_index_3"}}'
- '{"created_at": "2019-10-01"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public class FieldCapabilitiesIndexRequest extends ActionRequest implements Indi
// For serialization
FieldCapabilitiesIndexRequest(StreamInput in) throws IOException {
super(in);
if (in.readBoolean()) {
shardId = new ShardId(in);
}
shardId = in.readOptionalWriteable(ShardId::new);
index = in.readOptionalString();
fields = in.readStringArray();
originalIndices = OriginalIndices.readOriginalIndices(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public TransportFieldCapabilitiesAction(TransportService transportService, Clust

@Override
protected void doExecute(Task task, FieldCapabilitiesRequest request, final ActionListener<FieldCapabilitiesResponse> listener) {
// retrieve the initial timestamp in case the action is a cross cluster search
long nowInMillis = request.nowInMillis() == null ? System.currentTimeMillis() : request.nowInMillis();
final ClusterState clusterState = clusterService.state();
final Map<String, OriginalIndices> remoteClusterIndices = remoteClusterService.groupIndices(request.indicesOptions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ private ClusterBlockException checkRequestBlock(ClusterState state, String concr
}

/**
* An action that executes on each shard until it finds a replica that can match the provided
* {@link FieldCapabilitiesIndexRequest#indexFilter()}. In which case the replica is used
* An action that executes on each shard sequentially until it finds one that can match the provided
* {@link FieldCapabilitiesIndexRequest#indexFilter()}. In which case the shard is used
* to create the final {@link FieldCapabilitiesIndexResponse}.
*/
class AsyncShardsAction {
Expand Down

0 comments on commit fb3007c

Please sign in to comment.