-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Run cluster info requests on local node #120982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
08ae48e
d4a9413
e61990f
67e44b8
a15e197
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 120982 | ||
summary: Run cluster info requests on local node | ||
area: Indices APIs | ||
type: enhancement | ||
issues: [] |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,6 @@ | |
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; | ||
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsAction; | ||
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest; | ||
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsAction; | ||
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; | ||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; | ||
import org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction; | ||
import org.elasticsearch.action.admin.indices.open.OpenIndexAction; | ||
|
@@ -516,16 +514,6 @@ public void testDeleteIndex() { | |
assertSameIndices(deleteIndexRequest, TransportDeleteIndexAction.TYPE.name()); | ||
} | ||
|
||
public void testGetMappings() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I deleted this test because it didn't seem to make much sense to keep it when we run the action on the local node -- and it was failing. |
||
interceptTransportActions(GetMappingsAction.NAME); | ||
|
||
GetMappingsRequest getMappingsRequest = new GetMappingsRequest(TEST_REQUEST_TIMEOUT).indices(randomIndicesOrAliases()); | ||
internalCluster().coordOnlyNodeClient().admin().indices().getMappings(getMappingsRequest).actionGet(); | ||
|
||
clearInterceptedActions(); | ||
assertSameIndices(getMappingsRequest, GetMappingsAction.NAME); | ||
} | ||
|
||
public void testPutMapping() { | ||
interceptTransportActions(TransportPutMappingAction.TYPE.name()); | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -17,16 +17,12 @@ | |||
import org.elasticsearch.common.util.ArrayUtils; | ||||
import org.elasticsearch.core.TimeValue; | ||||
import org.elasticsearch.rest.RestRequest; | ||||
import org.elasticsearch.tasks.CancellableTask; | ||||
import org.elasticsearch.tasks.Task; | ||||
import org.elasticsearch.tasks.TaskId; | ||||
|
||||
import java.io.IOException; | ||||
import java.util.ArrayList; | ||||
import java.util.EnumSet; | ||||
import java.util.List; | ||||
import java.util.Locale; | ||||
import java.util.Map; | ||||
import java.util.Set; | ||||
|
||||
/** | ||||
|
@@ -98,6 +94,10 @@ public GetIndexRequest(TimeValue masterTimeout) { | |||
super(masterTimeout, IndicesOptions.strictExpandOpen()); | ||||
} | ||||
|
||||
/** | ||||
* Even though this action is executed on the local node, we still need to be able to read an incoming request as it's used across | ||||
* clusters. | ||||
*/ | ||||
Comment on lines
+97
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is worth discussing. It looks like the elasticsearch/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexAction.java Line 19 in a59c182
which means we'll need to support transport serialization for both GetIndexRequest and GetIndexResponse . That in turn meant I had to remove final LocalClusterStateRequest#writeTo (see further down this PR). I don't really see a way around this but any suggestions are welcome.
We could also add |
||||
public GetIndexRequest(StreamInput in) throws IOException { | ||||
super(in); | ||||
features = in.readArray(i -> Feature.fromId(i.readByte()), Feature[]::new); | ||||
|
@@ -168,9 +168,4 @@ public void writeTo(StreamOutput out) throws IOException { | |||
out.writeBoolean(humanReadable); | ||||
out.writeBoolean(includeDefaults); | ||||
} | ||||
|
||||
@Override | ||||
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { | ||||
return new CancellableTask(id, type, action, getDescription(), parentTaskId, headers); | ||||
} | ||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param for the
GetFieldMapping
API was deprecated in #55014 and I think #57265 aimed to propagate that deprecation to the REST API spec, but it changedget_mapping.json
instead ofget_field_mapping.json
. #55100 removed thelocal
param for the field mapping API but the regular mapping API still supports thelocal
param. That's why I'm deleting the param here and deprecating it inget_mapping.json
below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you pull this out to a separate PR?