Transport: better categorization for transport actions
Our transport relies on action names that tell what we need to do with each message received and sent on any node, together with the content of the request itself. The action names could use a better categorization and more consistent naming though, the following are the categories introduced with this commit: - indices: for all the apis that execute against indices - admin: for the apis that allow to perform administration tasks against indices - data: for the apis that are about data - read: apis that read data - write: apis that write data - benchmark: apis that run benchmarks - cluster: for all the cluster apis - admin: for the cluster apis that allow to perform administration tasks - monitor: for the cluster apis that allow to monitor the system - internal: for all the internal actions that are used from node to node but not directly exposed to users The change is applied in a backwards compatible manner: we keep the mapping old-to-new action name around, and when receiving a message, depending on the version of the node we receive it from, we use the received action name or we convert it to the previous version (old to new if version < 1.4). When sending a message, depending on the version of the node we talk to, we use the updated action or we convert it to the previous version (new to old if version < 1.4). For the cases where we don't know the version of the node we talk to, namely unicast ping, transport client nodes info and transport client sniff mode (which calls cluster state), we just use a lower bound for the version, thus we will always use the old action name, which can be understood by both old nodes and new nodes. Added test that enforces known updated categories for transport action names and test that verifies all action names have a pre 1.4 version for bw compatibility Added backwards compatibility tests for unicast and transport client in sniff mode, the one for the ordinary transport client (which calls nodes info) is implicit as it's used all the time in our bw comp tests. Added also backwards comp test that sends an empty message to any of the registered transport handler exposed by older nodes and verifies that what gets back is not ActionNotFoundTransportException, which would mean that there is a problem in the actions mappings. Added TestCluster#getClusterName abstract method and allow to retrieve externalTransportAddress and internalCluster from CompositeTestCluster. Closes #7105
This commit is contained in:
parent
a58d9a1dd0
commit
d2fea5378a
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterHealthAction extends ClusterAction<ClusterHealthRequest, ClusterHealthResponse, ClusterHealthRequestBuilder> {
|
||||
|
||||
public static final ClusterHealthAction INSTANCE = new ClusterHealthAction();
|
||||
public static final String NAME = "cluster/health";
|
||||
public static final String NAME = "cluster:monitor/health";
|
||||
|
||||
private ClusterHealthAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class NodesHotThreadsAction extends ClusterAction<NodesHotThreadsRequest, NodesHotThreadsResponse, NodesHotThreadsRequestBuilder> {
|
||||
|
||||
public static final NodesHotThreadsAction INSTANCE = new NodesHotThreadsAction();
|
||||
public static final String NAME = "cluster/nodes/hot_threads";
|
||||
public static final String NAME = "cluster:monitor/nodes/hot_threads";
|
||||
|
||||
private NodesHotThreadsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class NodesInfoAction extends ClusterAction<NodesInfoRequest, NodesInfoResponse, NodesInfoRequestBuilder> {
|
||||
|
||||
public static final NodesInfoAction INSTANCE = new NodesInfoAction();
|
||||
public static final String NAME = "cluster/nodes/info";
|
||||
public static final String NAME = "cluster:monitor/nodes/info";
|
||||
|
||||
private NodesInfoAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class NodesRestartAction extends ClusterAction<NodesRestartRequest, NodesRestartResponse, NodesRestartRequestBuilder> {
|
||||
|
||||
public static final NodesRestartAction INSTANCE = new NodesRestartAction();
|
||||
public static final String NAME = "cluster/nodes/restart";
|
||||
public static final String NAME = "cluster:admin/nodes/restart";
|
||||
|
||||
private NodesRestartAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class NodesShutdownAction extends ClusterAction<NodesShutdownRequest, NodesShutdownResponse, NodesShutdownRequestBuilder> {
|
||||
|
||||
public static final NodesShutdownAction INSTANCE = new NodesShutdownAction();
|
||||
public static final String NAME = "cluster/nodes/shutdown";
|
||||
public static final String NAME = "cluster:admin/nodes/shutdown";
|
||||
|
||||
private NodesShutdownAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -47,6 +47,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
*/
|
||||
public class TransportNodesShutdownAction extends TransportMasterNodeOperationAction<NodesShutdownRequest, NodesShutdownResponse> {
|
||||
|
||||
public static final String SHUTDOWN_NODE_ACTION_NAME = NodesShutdownAction.NAME + "[n]";
|
||||
|
||||
private final Node node;
|
||||
private final ClusterName clusterName;
|
||||
private final boolean disabled;
|
||||
|
@ -61,7 +63,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
this.disabled = settings.getAsBoolean("action.disable_shutdown", componentSettings.getAsBoolean("disabled", false));
|
||||
this.delay = componentSettings.getAsTime("delay", TimeValue.timeValueMillis(200));
|
||||
|
||||
this.transportService.registerHandler(NodeShutdownRequestHandler.ACTION, new NodeShutdownRequestHandler());
|
||||
this.transportService.registerHandler(SHUTDOWN_NODE_ACTION_NAME, new NodeShutdownRequestHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,7 +124,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
latch.countDown();
|
||||
} else {
|
||||
logger.trace("[cluster_shutdown]: sending shutdown request to [{}]", node);
|
||||
transportService.sendRequest(node, NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
transportService.sendRequest(node, SHUTDOWN_NODE_ACTION_NAME, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleResponse(TransportResponse.Empty response) {
|
||||
logger.trace("[cluster_shutdown]: received shutdown response from [{}]", node);
|
||||
|
@ -146,7 +148,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
|
||||
// now, kill the master
|
||||
logger.trace("[cluster_shutdown]: shutting down the master [{}]", state.nodes().masterNode());
|
||||
transportService.sendRequest(state.nodes().masterNode(), NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
transportService.sendRequest(state.nodes().masterNode(), SHUTDOWN_NODE_ACTION_NAME, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleResponse(TransportResponse.Empty response) {
|
||||
logger.trace("[cluster_shutdown]: received shutdown response from master");
|
||||
|
@ -190,7 +192,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
}
|
||||
|
||||
logger.trace("[partial_cluster_shutdown]: sending shutdown request to [{}]", node);
|
||||
transportService.sendRequest(node, NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
transportService.sendRequest(node, SHUTDOWN_NODE_ACTION_NAME, new NodeShutdownRequest(request), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleResponse(TransportResponse.Empty response) {
|
||||
logger.trace("[partial_cluster_shutdown]: received shutdown response from [{}]", node);
|
||||
|
@ -221,8 +223,6 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
|
||||
private class NodeShutdownRequestHandler extends BaseTransportRequestHandler<NodeShutdownRequest> {
|
||||
|
||||
static final String ACTION = "/cluster/nodes/shutdown/node";
|
||||
|
||||
@Override
|
||||
public NodeShutdownRequest newInstance() {
|
||||
return new NodeShutdownRequest();
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class NodesStatsAction extends ClusterAction<NodesStatsRequest, NodesStatsResponse, NodesStatsRequestBuilder> {
|
||||
|
||||
public static final NodesStatsAction INSTANCE = new NodesStatsAction();
|
||||
public static final String NAME = "cluster/nodes/stats";
|
||||
public static final String NAME = "cluster:monitor/nodes/stats";
|
||||
|
||||
private NodesStatsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class DeleteRepositoryAction extends ClusterAction<DeleteRepositoryRequest, DeleteRepositoryResponse, DeleteRepositoryRequestBuilder> {
|
||||
|
||||
public static final DeleteRepositoryAction INSTANCE = new DeleteRepositoryAction();
|
||||
public static final String NAME = "cluster/repository/delete";
|
||||
public static final String NAME = "cluster:admin/repository/delete";
|
||||
|
||||
private DeleteRepositoryAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class GetRepositoriesAction extends ClusterAction<GetRepositoriesRequest, GetRepositoriesResponse, GetRepositoriesRequestBuilder> {
|
||||
|
||||
public static final GetRepositoriesAction INSTANCE = new GetRepositoriesAction();
|
||||
public static final String NAME = "cluster/repository/get";
|
||||
public static final String NAME = "cluster:admin/repository/get";
|
||||
|
||||
private GetRepositoriesAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class PutRepositoryAction extends ClusterAction<PutRepositoryRequest, PutRepositoryResponse, PutRepositoryRequestBuilder> {
|
||||
|
||||
public static final PutRepositoryAction INSTANCE = new PutRepositoryAction();
|
||||
public static final String NAME = "cluster/repository/put";
|
||||
public static final String NAME = "cluster:admin/repository/put";
|
||||
|
||||
private PutRepositoryAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterRerouteAction extends ClusterAction<ClusterRerouteRequest, ClusterRerouteResponse, ClusterRerouteRequestBuilder> {
|
||||
|
||||
public static final ClusterRerouteAction INSTANCE = new ClusterRerouteAction();
|
||||
public static final String NAME = "cluster/reroute";
|
||||
public static final String NAME = "cluster:admin/reroute";
|
||||
|
||||
private ClusterRerouteAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterUpdateSettingsAction extends ClusterAction<ClusterUpdateSettingsRequest, ClusterUpdateSettingsResponse, ClusterUpdateSettingsRequestBuilder> {
|
||||
|
||||
public static final ClusterUpdateSettingsAction INSTANCE = new ClusterUpdateSettingsAction();
|
||||
public static final String NAME = "cluster/settings/update";
|
||||
public static final String NAME = "cluster:admin/settings/update";
|
||||
|
||||
private ClusterUpdateSettingsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterSearchShardsAction extends ClusterAction<ClusterSearchShardsRequest, ClusterSearchShardsResponse, ClusterSearchShardsRequestBuilder> {
|
||||
|
||||
public static final ClusterSearchShardsAction INSTANCE = new ClusterSearchShardsAction();
|
||||
public static final String NAME = "cluster/shards/search_shards";
|
||||
public static final String NAME = "indices:admin/shards/search_shards";
|
||||
|
||||
private ClusterSearchShardsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class CreateSnapshotAction extends ClusterAction<CreateSnapshotRequest, CreateSnapshotResponse, CreateSnapshotRequestBuilder> {
|
||||
|
||||
public static final CreateSnapshotAction INSTANCE = new CreateSnapshotAction();
|
||||
public static final String NAME = "cluster/snapshot/create";
|
||||
public static final String NAME = "cluster:admin/snapshot/create";
|
||||
|
||||
private CreateSnapshotAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class DeleteSnapshotAction extends ClusterAction<DeleteSnapshotRequest, DeleteSnapshotResponse, DeleteSnapshotRequestBuilder> {
|
||||
|
||||
public static final DeleteSnapshotAction INSTANCE = new DeleteSnapshotAction();
|
||||
public static final String NAME = "cluster/snapshot/delete";
|
||||
public static final String NAME = "cluster:admin/snapshot/delete";
|
||||
|
||||
private DeleteSnapshotAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class GetSnapshotsAction extends ClusterAction<GetSnapshotsRequest, GetSnapshotsResponse, GetSnapshotsRequestBuilder> {
|
||||
|
||||
public static final GetSnapshotsAction INSTANCE = new GetSnapshotsAction();
|
||||
public static final String NAME = "cluster/snapshot/get";
|
||||
public static final String NAME = "cluster:admin/snapshot/get";
|
||||
|
||||
private GetSnapshotsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class RestoreSnapshotAction extends ClusterAction<RestoreSnapshotRequest, RestoreSnapshotResponse, RestoreSnapshotRequestBuilder> {
|
||||
|
||||
public static final RestoreSnapshotAction INSTANCE = new RestoreSnapshotAction();
|
||||
public static final String NAME = "cluster/snapshot/restore";
|
||||
public static final String NAME = "cluster:admin/snapshot/restore";
|
||||
|
||||
private RestoreSnapshotAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class SnapshotsStatusAction extends ClusterAction<SnapshotsStatusRequest, SnapshotsStatusResponse, SnapshotsStatusRequestBuilder> {
|
||||
|
||||
public static final SnapshotsStatusAction INSTANCE = new SnapshotsStatusAction();
|
||||
public static final String NAME = "cluster/snapshot/status";
|
||||
public static final String NAME = "cluster:admin/snapshot/status";
|
||||
|
||||
private SnapshotsStatusAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -51,7 +51,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
|
|||
*/
|
||||
public class TransportNodesSnapshotsStatus extends TransportNodesOperationAction<TransportNodesSnapshotsStatus.Request, TransportNodesSnapshotsStatus.NodesSnapshotStatus, TransportNodesSnapshotsStatus.NodeRequest, TransportNodesSnapshotsStatus.NodeSnapshotStatus> {
|
||||
|
||||
private static final String ACTION_NAME = "cluster/snapshot/status/nodes";
|
||||
public static final String ACTION_NAME = SnapshotsStatusAction.NAME + "[nodes]";
|
||||
|
||||
private final SnapshotsService snapshotsService;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterStateAction extends ClusterAction<ClusterStateRequest, ClusterStateResponse, ClusterStateRequestBuilder> {
|
||||
|
||||
public static final ClusterStateAction INSTANCE = new ClusterStateAction();
|
||||
public static final String NAME = "cluster/state";
|
||||
public static final String NAME = "cluster:monitor/state";
|
||||
|
||||
private ClusterStateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class ClusterStatsAction extends ClusterAction<ClusterStatsRequest, ClusterStatsResponse, ClusterStatsRequestBuilder> {
|
||||
|
||||
public static final ClusterStatsAction INSTANCE = new ClusterStatsAction();
|
||||
public static final String NAME = "cluster/stats";
|
||||
public static final String NAME = "cluster:monitor/stats";
|
||||
|
||||
private ClusterStatsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
public class PendingClusterTasksAction extends ClusterAction<PendingClusterTasksRequest, PendingClusterTasksResponse, PendingClusterTasksRequestBuilder> {
|
||||
|
||||
public static final PendingClusterTasksAction INSTANCE = new PendingClusterTasksAction();
|
||||
public static final String NAME = "cluster/task";
|
||||
public static final String NAME = "cluster:monitor/task";
|
||||
|
||||
private PendingClusterTasksAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class IndicesAliasesAction extends IndicesAction<IndicesAliasesRequest, IndicesAliasesResponse, IndicesAliasesRequestBuilder> {
|
||||
|
||||
public static final IndicesAliasesAction INSTANCE = new IndicesAliasesAction();
|
||||
public static final String NAME = "indices/aliases";
|
||||
public static final String NAME = "indices:admin/aliases";
|
||||
|
||||
private IndicesAliasesAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class AliasesExistAction extends IndicesAction<GetAliasesRequest, AliasesExistResponse, AliasesExistRequestBuilder> {
|
||||
|
||||
public static final AliasesExistAction INSTANCE = new AliasesExistAction();
|
||||
public static final String NAME = "indices/exists/aliases";
|
||||
public static final String NAME = "indices:admin/aliases/exists";
|
||||
|
||||
private AliasesExistAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetAliasesAction extends IndicesAction<GetAliasesRequest, GetAliasesResponse, GetAliasesRequestBuilder> {
|
||||
|
||||
public static final GetAliasesAction INSTANCE = new GetAliasesAction();
|
||||
public static final String NAME = "indices/get/aliases";
|
||||
public static final String NAME = "indices:admin/aliases/get";
|
||||
|
||||
private GetAliasesAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class AnalyzeAction extends IndicesAction<AnalyzeRequest, AnalyzeResponse, AnalyzeRequestBuilder> {
|
||||
|
||||
public static final AnalyzeAction INSTANCE = new AnalyzeAction();
|
||||
public static final String NAME = "indices/analyze";
|
||||
public static final String NAME = "indices:admin/analyze";
|
||||
|
||||
private AnalyzeAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class ClearIndicesCacheAction extends IndicesAction<ClearIndicesCacheRequest, ClearIndicesCacheResponse, ClearIndicesCacheRequestBuilder> {
|
||||
|
||||
public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction();
|
||||
public static final String NAME = "indices/cache/clear";
|
||||
public static final String NAME = "indices:admin/cache/clear";
|
||||
|
||||
private ClearIndicesCacheAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class CloseIndexAction extends IndicesAction<CloseIndexRequest, CloseIndexResponse, CloseIndexRequestBuilder> {
|
||||
|
||||
public static final CloseIndexAction INSTANCE = new CloseIndexAction();
|
||||
public static final String NAME = "indices/close";
|
||||
public static final String NAME = "indices:admin/close";
|
||||
|
||||
private CloseIndexAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class CreateIndexAction extends IndicesAction<CreateIndexRequest, CreateIndexResponse, CreateIndexRequestBuilder> {
|
||||
|
||||
public static final CreateIndexAction INSTANCE = new CreateIndexAction();
|
||||
public static final String NAME = "indices/create";
|
||||
public static final String NAME = "indices:admin/create";
|
||||
|
||||
private CreateIndexAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class DeleteIndexAction extends IndicesAction<DeleteIndexRequest, DeleteIndexResponse, DeleteIndexRequestBuilder> {
|
||||
|
||||
public static final DeleteIndexAction INSTANCE = new DeleteIndexAction();
|
||||
public static final String NAME = "indices/delete";
|
||||
public static final String NAME = "indices:admin/delete";
|
||||
|
||||
private DeleteIndexAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class IndicesExistsAction extends IndicesAction<IndicesExistsRequest, IndicesExistsResponse, IndicesExistsRequestBuilder> {
|
||||
|
||||
public static final IndicesExistsAction INSTANCE = new IndicesExistsAction();
|
||||
public static final String NAME = "indices/exists";
|
||||
public static final String NAME = "indices:admin/exists";
|
||||
|
||||
private IndicesExistsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class TypesExistsAction extends IndicesAction<TypesExistsRequest, TypesExistsResponse, TypesExistsRequestBuilder> {
|
||||
|
||||
public static final TypesExistsAction INSTANCE = new TypesExistsAction();
|
||||
public static final String NAME = "indices/types/exists";
|
||||
public static final String NAME = "indices:admin/types/exists";
|
||||
|
||||
private TypesExistsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class FlushAction extends IndicesAction<FlushRequest, FlushResponse, FlushRequestBuilder> {
|
||||
|
||||
public static final FlushAction INSTANCE = new FlushAction();
|
||||
public static final String NAME = "indices/flush";
|
||||
public static final String NAME = "indices:admin/flush";
|
||||
|
||||
private FlushAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class DeleteMappingAction extends IndicesAction<DeleteMappingRequest, DeleteMappingResponse, DeleteMappingRequestBuilder> {
|
||||
|
||||
public static final DeleteMappingAction INSTANCE = new DeleteMappingAction();
|
||||
public static final String NAME = "indices/mapping/delete";
|
||||
public static final String NAME = "indices:admin/mapping/delete";
|
||||
|
||||
private DeleteMappingAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetFieldMappingsAction extends IndicesAction<GetFieldMappingsRequest, GetFieldMappingsResponse, GetFieldMappingsRequestBuilder> {
|
||||
|
||||
public static final GetFieldMappingsAction INSTANCE = new GetFieldMappingsAction();
|
||||
public static final String NAME = "mappings/fields/get";
|
||||
public static final String NAME = "indices:admin/mappings/fields/get";
|
||||
|
||||
private GetFieldMappingsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetMappingsAction extends IndicesAction<GetMappingsRequest, GetMappingsResponse, GetMappingsRequestBuilder> {
|
||||
|
||||
public static final GetMappingsAction INSTANCE = new GetMappingsAction();
|
||||
public static final String NAME = "mappings/get";
|
||||
public static final String NAME = "indices:admin/mappings/get";
|
||||
|
||||
private GetMappingsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -56,7 +56,7 @@ import java.util.List;
|
|||
*/
|
||||
public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomOperationAction<GetFieldMappingsIndexRequest, GetFieldMappingsResponse> {
|
||||
|
||||
private static final String ACTION_NAME = GetFieldMappingsAction.NAME + "/index";
|
||||
private static final String ACTION_NAME = GetFieldMappingsAction.NAME + "[index]";
|
||||
|
||||
protected final ClusterService clusterService;
|
||||
private final IndicesService indicesService;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class PutMappingAction extends IndicesAction<PutMappingRequest, PutMappingResponse, PutMappingRequestBuilder> {
|
||||
|
||||
public static final PutMappingAction INSTANCE = new PutMappingAction();
|
||||
public static final String NAME = "indices/mapping/put";
|
||||
public static final String NAME = "indices:admin/mapping/put";
|
||||
|
||||
private PutMappingAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class OpenIndexAction extends IndicesAction<OpenIndexRequest, OpenIndexResponse, OpenIndexRequestBuilder> {
|
||||
|
||||
public static final OpenIndexAction INSTANCE = new OpenIndexAction();
|
||||
public static final String NAME = "indices/open";
|
||||
public static final String NAME = "indices:admin/open";
|
||||
|
||||
private OpenIndexAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class OptimizeAction extends IndicesAction<OptimizeRequest, OptimizeResponse, OptimizeRequestBuilder> {
|
||||
|
||||
public static final OptimizeAction INSTANCE = new OptimizeAction();
|
||||
public static final String NAME = "indices/optimize";
|
||||
public static final String NAME = "indices:admin/optimize";
|
||||
|
||||
private OptimizeAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.action.admin.indices.IndicesAction;
|
|||
public class RecoveryAction extends IndicesAction<RecoveryRequest, RecoveryResponse, RecoveryRequestBuilder> {
|
||||
|
||||
public static final RecoveryAction INSTANCE = new RecoveryAction();
|
||||
public static final String NAME = "indices/recovery";
|
||||
public static final String NAME = "indices:monitor/recovery";
|
||||
|
||||
private RecoveryAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class RefreshAction extends IndicesAction<RefreshRequest, RefreshResponse, RefreshRequestBuilder> {
|
||||
|
||||
public static final RefreshAction INSTANCE = new RefreshAction();
|
||||
public static final String NAME = "indices/refresh";
|
||||
public static final String NAME = "indices:admin/refresh";
|
||||
|
||||
private RefreshAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class IndicesSegmentsAction extends IndicesAction<IndicesSegmentsRequest, IndicesSegmentResponse, IndicesSegmentsRequestBuilder> {
|
||||
|
||||
public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction();
|
||||
public static final String NAME = "indices/segments";
|
||||
public static final String NAME = "indices:monitor/segments";
|
||||
|
||||
private IndicesSegmentsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetSettingsAction extends IndicesAction<GetSettingsRequest, GetSettingsResponse, GetSettingsRequestBuilder> {
|
||||
|
||||
public static final GetSettingsAction INSTANCE = new GetSettingsAction();
|
||||
public static final String NAME = "indices/settings/get";
|
||||
public static final String NAME = "indices:monitor/settings/get";
|
||||
|
||||
public GetSettingsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class UpdateSettingsAction extends IndicesAction<UpdateSettingsRequest, UpdateSettingsResponse, UpdateSettingsRequestBuilder> {
|
||||
|
||||
public static final UpdateSettingsAction INSTANCE = new UpdateSettingsAction();
|
||||
public static final String NAME = "indices/settings/update";
|
||||
public static final String NAME = "indices:admin/settings/update";
|
||||
|
||||
private UpdateSettingsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class IndicesStatsAction extends IndicesAction<IndicesStatsRequest, IndicesStatsResponse, IndicesStatsRequestBuilder> {
|
||||
|
||||
public static final IndicesStatsAction INSTANCE = new IndicesStatsAction();
|
||||
public static final String NAME = "indices/stats";
|
||||
public static final String NAME = "indices:monitor/stats";
|
||||
|
||||
private IndicesStatsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class DeleteIndexTemplateAction extends IndicesAction<DeleteIndexTemplateRequest, DeleteIndexTemplateResponse, DeleteIndexTemplateRequestBuilder> {
|
||||
|
||||
public static final DeleteIndexTemplateAction INSTANCE = new DeleteIndexTemplateAction();
|
||||
public static final String NAME = "indices/template/delete";
|
||||
public static final String NAME = "indices:admin/template/delete";
|
||||
|
||||
private DeleteIndexTemplateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetIndexTemplatesAction extends IndicesAction<GetIndexTemplatesRequest, GetIndexTemplatesResponse, GetIndexTemplatesRequestBuilder> {
|
||||
|
||||
public static final GetIndexTemplatesAction INSTANCE = new GetIndexTemplatesAction();
|
||||
public static final String NAME = "indices/template/get";
|
||||
public static final String NAME = "indices:admin/template/get";
|
||||
|
||||
protected GetIndexTemplatesAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class PutIndexTemplateAction extends IndicesAction<PutIndexTemplateRequest, PutIndexTemplateResponse, PutIndexTemplateRequestBuilder> {
|
||||
|
||||
public static final PutIndexTemplateAction INSTANCE = new PutIndexTemplateAction();
|
||||
public static final String NAME = "indices/template/put";
|
||||
public static final String NAME = "indices:admin/template/put";
|
||||
|
||||
private PutIndexTemplateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class ValidateQueryAction extends IndicesAction<ValidateQueryRequest, ValidateQueryResponse, ValidateQueryRequestBuilder> {
|
||||
|
||||
public static final ValidateQueryAction INSTANCE = new ValidateQueryAction();
|
||||
public static final String NAME = "indices/validate/query";
|
||||
public static final String NAME = "indices:admin/validate/query";
|
||||
|
||||
private ValidateQueryAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class DeleteWarmerAction extends IndicesAction<DeleteWarmerRequest, DeleteWarmerResponse, DeleteWarmerRequestBuilder> {
|
||||
|
||||
public static final DeleteWarmerAction INSTANCE = new DeleteWarmerAction();
|
||||
public static final String NAME = "indices/warmer/delete";
|
||||
public static final String NAME = "indices:admin/warmers/delete";
|
||||
|
||||
private DeleteWarmerAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class GetWarmersAction extends IndicesAction<GetWarmersRequest, GetWarmersResponse, GetWarmersRequestBuilder> {
|
||||
|
||||
public static final GetWarmersAction INSTANCE = new GetWarmersAction();
|
||||
public static final String NAME = "warmers/get";
|
||||
public static final String NAME = "indices:admin/warmers/get";
|
||||
|
||||
private GetWarmersAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.IndicesAdminClient;
|
|||
public class PutWarmerAction extends IndicesAction<PutWarmerRequest, PutWarmerResponse, PutWarmerRequestBuilder> {
|
||||
|
||||
public static final PutWarmerAction INSTANCE = new PutWarmerAction();
|
||||
public static final String NAME = "indices/warmer/put";
|
||||
public static final String NAME = "indices:admin/warmers/put";
|
||||
|
||||
private PutWarmerAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.Client;
|
|||
public class AbortBenchmarkAction extends ClientAction<AbortBenchmarkRequest, AbortBenchmarkResponse, AbortBenchmarkRequestBuilder> {
|
||||
|
||||
public static final AbortBenchmarkAction INSTANCE = new AbortBenchmarkAction();
|
||||
public static final String NAME = "benchmark/abort";
|
||||
public static final String NAME = "indices:data/benchmark/abort";
|
||||
|
||||
private AbortBenchmarkAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.common.Strings;
|
|||
public class BenchmarkAction extends ClientAction<BenchmarkRequest, BenchmarkResponse, BenchmarkRequestBuilder> {
|
||||
|
||||
public static final BenchmarkAction INSTANCE = new BenchmarkAction();
|
||||
public static final String NAME = "benchmark/start";
|
||||
public static final String NAME = "indices:data/benchmark/start";
|
||||
|
||||
private BenchmarkAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -59,6 +59,10 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
private final TransportService transportService;
|
||||
protected final BenchmarkExecutor executor;
|
||||
|
||||
public static final String ABORT_ACTION_NAME = "indices:data/benchmark/executor/abort";
|
||||
public static final String STATUS_ACTION_NAME = "indices:data/benchmark/executor/status";
|
||||
public static final String START_ACTION_NAME = "indices:data/benchmark/executor/start";
|
||||
|
||||
/**
|
||||
* Constructs a service component for running benchmarks
|
||||
*
|
||||
|
@ -76,9 +80,9 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
this.executor = new BenchmarkExecutor(client, clusterService);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
transportService.registerHandler(BenchExecutionHandler.ACTION, new BenchExecutionHandler());
|
||||
transportService.registerHandler(AbortExecutionHandler.ACTION, new AbortExecutionHandler());
|
||||
transportService.registerHandler(StatusExecutionHandler.ACTION, new StatusExecutionHandler());
|
||||
transportService.registerHandler(START_ACTION_NAME, new BenchExecutionHandler());
|
||||
transportService.registerHandler(ABORT_ACTION_NAME, new AbortExecutionHandler());
|
||||
transportService.registerHandler(STATUS_ACTION_NAME, new StatusExecutionHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,7 +109,7 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
BenchmarkStatusAsyncHandler async = new BenchmarkStatusAsyncHandler(nodes.size(), request, listener);
|
||||
for (DiscoveryNode node : nodes) {
|
||||
assert isBenchmarkNode(node);
|
||||
transportService.sendRequest(node, StatusExecutionHandler.ACTION, new NodeStatusRequest(request), async);
|
||||
transportService.sendRequest(node, STATUS_ACTION_NAME, new NodeStatusRequest(request), async);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +146,7 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
for (String nodeId : nodeNames) {
|
||||
final DiscoveryNode node = nodes.get(nodeId);
|
||||
if (node != null) {
|
||||
transportService.sendRequest(node, AbortExecutionHandler.ACTION, new NodeAbortRequest(benchmarkNames), asyncHandler);
|
||||
transportService.sendRequest(node, ABORT_ACTION_NAME, new NodeAbortRequest(benchmarkNames), asyncHandler);
|
||||
} else {
|
||||
asyncHandler.countDown.countDown();
|
||||
logger.debug("Node for ID [" + nodeId + "] not found in cluster state - skipping");
|
||||
|
@ -194,7 +198,7 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
new ElasticsearchIllegalStateException("Node for ID [" + nodeId + "] not found in cluster state - skipping"));
|
||||
} else {
|
||||
logger.debug("Starting benchmark [{}] node [{}]", request.benchmarkName(), node.name());
|
||||
transportService.sendRequest(node, BenchExecutionHandler.ACTION, new NodeBenchRequest(request), async);
|
||||
transportService.sendRequest(node, START_ACTION_NAME, new NodeBenchRequest(request), async);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +261,6 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
|
||||
private class BenchExecutionHandler extends BaseTransportRequestHandler<NodeBenchRequest> {
|
||||
|
||||
static final String ACTION = "benchmark/executor/start";
|
||||
|
||||
@Override
|
||||
public NodeBenchRequest newInstance() {
|
||||
return new NodeBenchRequest();
|
||||
|
@ -278,8 +280,6 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
|
||||
private class StatusExecutionHandler extends BaseTransportRequestHandler<NodeStatusRequest> {
|
||||
|
||||
static final String ACTION = "benchmark/executor/status";
|
||||
|
||||
@Override
|
||||
public NodeStatusRequest newInstance() {
|
||||
return new NodeStatusRequest();
|
||||
|
@ -301,8 +301,6 @@ public class BenchmarkService extends AbstractLifecycleComponent<BenchmarkServic
|
|||
|
||||
private class AbortExecutionHandler extends BaseTransportRequestHandler<NodeAbortRequest> {
|
||||
|
||||
static final String ACTION = "benchmark/executor/abort";
|
||||
|
||||
@Override
|
||||
public NodeAbortRequest newInstance() {
|
||||
return new NodeAbortRequest();
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.Client;
|
|||
public class BenchmarkStatusAction extends ClientAction<BenchmarkStatusRequest, BenchmarkStatusResponse, BenchmarkStatusRequestBuilder> {
|
||||
|
||||
public static final BenchmarkStatusAction INSTANCE = new BenchmarkStatusAction();
|
||||
public static final String NAME = "benchmark/status";
|
||||
public static final String NAME = "indices:data/benchmark/status";
|
||||
|
||||
public BenchmarkStatusAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.transport.TransportRequestOptions;
|
|||
public class BulkAction extends ClientAction<BulkRequest, BulkResponse, BulkRequestBuilder> {
|
||||
|
||||
public static final BulkAction INSTANCE = new BulkAction();
|
||||
public static final String NAME = "bulk";
|
||||
public static final String NAME = "indices:data/write/bulk";
|
||||
|
||||
private BulkAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
|
|||
private final static String OP_TYPE_UPDATE = "update";
|
||||
private final static String OP_TYPE_DELETE = "delete";
|
||||
|
||||
private static final String ACTION_NAME = BulkAction.NAME + "/shard";
|
||||
private static final String ACTION_NAME = BulkAction.NAME + "[s]";
|
||||
|
||||
private final MappingUpdatedAction mappingUpdatedAction;
|
||||
private final UpdateHelper updateHelper;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class CountAction extends ClientAction<CountRequest, CountResponse, CountRequestBuilder> {
|
||||
|
||||
public static final CountAction INSTANCE = new CountAction();
|
||||
public static final String NAME = "count";
|
||||
public static final String NAME = "indices:data/read/count";
|
||||
|
||||
private CountAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class DeleteAction extends ClientAction<DeleteRequest, DeleteResponse, DeleteRequestBuilder> {
|
||||
|
||||
public static final DeleteAction INSTANCE = new DeleteAction();
|
||||
public static final String NAME = "delete";
|
||||
public static final String NAME = "indices:data/write/delete";
|
||||
|
||||
private DeleteAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.action.delete.index;
|
||||
|
||||
import org.elasticsearch.action.ShardOperationFailedException;
|
||||
import org.elasticsearch.action.delete.DeleteAction;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.replication.TransportIndexReplicationOperationAction;
|
||||
import org.elasticsearch.cluster.ClusterService;
|
||||
|
@ -39,7 +40,7 @@ import java.util.List;
|
|||
*/
|
||||
public class TransportIndexDeleteAction extends TransportIndexReplicationOperationAction<IndexDeleteRequest, IndexDeleteResponse, ShardDeleteRequest, ShardDeleteRequest, ShardDeleteResponse> {
|
||||
|
||||
private static final String ACTION_NAME = "indices/index/delete";
|
||||
private static final String ACTION_NAME = DeleteAction.NAME + "[index]";
|
||||
|
||||
@Inject
|
||||
public TransportIndexDeleteAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.action.delete.index;
|
||||
|
||||
import org.elasticsearch.ElasticsearchIllegalStateException;
|
||||
import org.elasticsearch.action.delete.DeleteAction;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction;
|
||||
import org.elasticsearch.cluster.ClusterService;
|
||||
|
@ -43,7 +44,7 @@ import org.elasticsearch.transport.TransportService;
|
|||
*/
|
||||
public class TransportShardDeleteAction extends TransportShardReplicationOperationAction<ShardDeleteRequest, ShardDeleteRequest, ShardDeleteResponse> {
|
||||
|
||||
private static final String ACTION_NAME = "indices/index/b_shard/delete";
|
||||
private static final String ACTION_NAME = DeleteAction.NAME + "[s]";
|
||||
|
||||
@Inject
|
||||
public TransportShardDeleteAction(Settings settings, TransportService transportService,
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class DeleteByQueryAction extends ClientAction<DeleteByQueryRequest, DeleteByQueryResponse, DeleteByQueryRequestBuilder> {
|
||||
|
||||
public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction();
|
||||
public static final String NAME = "deleteByQuery";
|
||||
public static final String NAME = "indices:data/write/delete/by_query";
|
||||
|
||||
private DeleteByQueryAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
|||
*/
|
||||
public class TransportIndexDeleteByQueryAction extends TransportIndexReplicationOperationAction<IndexDeleteByQueryRequest, IndexDeleteByQueryResponse, ShardDeleteByQueryRequest, ShardDeleteByQueryRequest, ShardDeleteByQueryResponse> {
|
||||
|
||||
private static final String ACTION_NAME = DeleteByQueryAction.NAME + "/index";
|
||||
private static final String ACTION_NAME = DeleteByQueryAction.NAME + "[index]";
|
||||
|
||||
@Inject
|
||||
public TransportIndexDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
|
|
|
@ -55,7 +55,7 @@ public class TransportShardDeleteByQueryAction extends TransportShardReplication
|
|||
|
||||
public final static String DELETE_BY_QUERY_API = "delete_by_query";
|
||||
|
||||
private static final String ACTION_NAME = DeleteByQueryAction.NAME + "/shard";
|
||||
private static final String ACTION_NAME = DeleteByQueryAction.NAME + "[s]";
|
||||
|
||||
private final ScriptService scriptService;
|
||||
private final CacheRecycler cacheRecycler;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.client.Client;
|
|||
public class ExistsAction extends ClientAction<ExistsRequest, ExistsResponse, ExistsRequestBuilder> {
|
||||
|
||||
public static final ExistsAction INSTANCE = new ExistsAction();
|
||||
public static final String NAME = "exists";
|
||||
public static final String NAME = "indices:data/read/exists";
|
||||
|
||||
private ExistsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.Client;
|
|||
public class ExplainAction extends ClientAction<ExplainRequest, ExplainResponse, ExplainRequestBuilder> {
|
||||
|
||||
public static final ExplainAction INSTANCE = new ExplainAction();
|
||||
public static final String NAME = "explain";
|
||||
public static final String NAME = "indices:data/read/explain";
|
||||
|
||||
private ExplainAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class GetAction extends ClientAction<GetRequest, GetResponse, GetRequestBuilder> {
|
||||
|
||||
public static final GetAction INSTANCE = new GetAction();
|
||||
public static final String NAME = "get";
|
||||
public static final String NAME = "indices:data/read/get";
|
||||
|
||||
private GetAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class MultiGetAction extends ClientAction<MultiGetRequest, MultiGetResponse, MultiGetRequestBuilder> {
|
||||
|
||||
public static final MultiGetAction INSTANCE = new MultiGetAction();
|
||||
public static final String NAME = "mget";
|
||||
public static final String NAME = "indices:data/read/mget";
|
||||
|
||||
private MultiGetAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -43,7 +43,7 @@ import org.elasticsearch.transport.TransportService;
|
|||
|
||||
public class TransportShardMultiGetAction extends TransportShardSingleOperationAction<MultiGetShardRequest, MultiGetShardResponse> {
|
||||
|
||||
private static final String ACTION_NAME = MultiGetAction.NAME + "/shard";
|
||||
private static final String ACTION_NAME = MultiGetAction.NAME + "[shard]";
|
||||
|
||||
private final IndicesService indicesService;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class IndexAction extends ClientAction<IndexRequest, IndexResponse, IndexRequestBuilder> {
|
||||
|
||||
public static final IndexAction INSTANCE = new IndexAction();
|
||||
public static final String NAME = "index";
|
||||
public static final String NAME = "indices:data/write/index";
|
||||
|
||||
private IndexAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class DeleteIndexedScriptAction extends ClientAction<DeleteIndexedScriptRequest, DeleteIndexedScriptResponse, DeleteIndexedScriptRequestBuilder> {
|
||||
|
||||
public static final DeleteIndexedScriptAction INSTANCE = new DeleteIndexedScriptAction();
|
||||
public static final String NAME = "deleteIndexedScript";
|
||||
public static final String NAME = "indices:data/write/script/delete";
|
||||
|
||||
private DeleteIndexedScriptAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class GetIndexedScriptAction extends ClientAction<GetIndexedScriptRequest, GetIndexedScriptResponse, GetIndexedScriptRequestBuilder> {
|
||||
|
||||
public static final GetIndexedScriptAction INSTANCE = new GetIndexedScriptAction();
|
||||
public static final String NAME = "getIndexedScript";
|
||||
public static final String NAME = "indices:data/read/script/get";
|
||||
|
||||
private GetIndexedScriptAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.Client;
|
|||
public class PutIndexedScriptAction extends ClientAction<PutIndexedScriptRequest, PutIndexedScriptResponse, PutIndexedScriptRequestBuilder> {
|
||||
|
||||
public static final PutIndexedScriptAction INSTANCE = new PutIndexedScriptAction();
|
||||
public static final String NAME = "putIndexedScript";
|
||||
public static final String NAME = "indices:data/write/script/put";
|
||||
|
||||
|
||||
private PutIndexedScriptAction() {
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.client.Client;
|
|||
public class MoreLikeThisAction extends ClientAction<MoreLikeThisRequest, SearchResponse, MoreLikeThisRequestBuilder> {
|
||||
|
||||
public static final MoreLikeThisAction INSTANCE = new MoreLikeThisAction();
|
||||
public static final String NAME = "mlt";
|
||||
public static final String NAME = "indices:data/read/mlt";
|
||||
|
||||
private MoreLikeThisAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.client.Client;
|
|||
public class MultiPercolateAction extends ClientAction<MultiPercolateRequest, MultiPercolateResponse, MultiPercolateRequestBuilder> {
|
||||
|
||||
public static final MultiPercolateAction INSTANCE = new MultiPercolateAction();
|
||||
public static final String NAME = "mpercolate";
|
||||
public static final String NAME = "indices:data/read/mpercolate";
|
||||
|
||||
private MultiPercolateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class PercolateAction extends ClientAction<PercolateRequest, PercolateResponse, PercolateRequestBuilder> {
|
||||
|
||||
public static final PercolateAction INSTANCE = new PercolateAction();
|
||||
public static final String NAME = "percolate";
|
||||
public static final String NAME = "indices:data/read/percolate";
|
||||
|
||||
private PercolateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -52,7 +52,7 @@ public class TransportShardMultiPercolateAction extends TransportShardSingleOper
|
|||
|
||||
private final PercolatorService percolatorService;
|
||||
|
||||
private static final String ACTION_NAME = "mpercolate/shard";
|
||||
private static final String ACTION_NAME = MultiPercolateAction.NAME + "[shard]";
|
||||
|
||||
@Inject
|
||||
public TransportShardMultiPercolateAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, PercolatorService percolatorService, ActionFilters actionFilters) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class ClearScrollAction extends ClientAction<ClearScrollRequest, ClearScrollResponse, ClearScrollRequestBuilder> {
|
||||
|
||||
public static final ClearScrollAction INSTANCE = new ClearScrollAction();
|
||||
public static final String NAME = "clear_sc";
|
||||
public static final String NAME = "indices:data/read/scroll/clear";
|
||||
|
||||
private ClearScrollAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class MultiSearchAction extends ClientAction<MultiSearchRequest, MultiSearchResponse, MultiSearchRequestBuilder> {
|
||||
|
||||
public static final MultiSearchAction INSTANCE = new MultiSearchAction();
|
||||
public static final String NAME = "msearch";
|
||||
public static final String NAME = "indices:data/read/msearch";
|
||||
|
||||
private MultiSearchAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class SearchAction extends ClientAction<SearchRequest, SearchResponse, SearchRequestBuilder> {
|
||||
|
||||
public static final SearchAction INSTANCE = new SearchAction();
|
||||
public static final String NAME = "search";
|
||||
public static final String NAME = "indices:data/read/search";
|
||||
|
||||
private SearchAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class SearchScrollAction extends ClientAction<SearchScrollRequest, SearchResponse, SearchScrollRequestBuilder> {
|
||||
|
||||
public static final SearchScrollAction INSTANCE = new SearchScrollAction();
|
||||
public static final String NAME = "search/scroll";
|
||||
public static final String NAME = "indices:data/read/scroll";
|
||||
|
||||
private SearchScrollAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.search.suggest.Suggest;
|
|||
public class SuggestAction extends ClientAction<SuggestRequest, SuggestResponse, SuggestRequestBuilder> {
|
||||
|
||||
public static final SuggestAction INSTANCE = new SuggestAction();
|
||||
public static final String NAME = "suggest";
|
||||
public static final String NAME = "indices:data/read/suggest";
|
||||
|
||||
private SuggestAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -59,7 +59,7 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
|||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.threadPool = threadPool;
|
||||
this.transportShardAction = actionName + "/s";
|
||||
this.transportShardAction = actionName + "[s]";
|
||||
this.executor = executor();
|
||||
|
||||
transportService.registerHandler(actionName, new TransportHandler());
|
||||
|
|
|
@ -58,7 +58,7 @@ public abstract class TransportNodesOperationAction<Request extends NodesOperati
|
|||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
|
||||
this.transportNodeAction = actionName + "/n";
|
||||
this.transportNodeAction = actionName + "[n]";
|
||||
this.executor = executor();
|
||||
|
||||
transportService.registerHandler(actionName, new TransportHandler());
|
||||
|
|
|
@ -151,7 +151,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
|||
}
|
||||
|
||||
private String transportReplicaAction() {
|
||||
return actionName + "/replica";
|
||||
return actionName + "[r]";
|
||||
}
|
||||
|
||||
protected boolean retryPrimaryException(Throwable e) {
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
|
||||
this.transportShardAction = actionName + "/s";
|
||||
this.transportShardAction = actionName + "[s]";
|
||||
this.executor = executor();
|
||||
|
||||
transportService.registerHandler(actionName, new TransportHandler());
|
||||
|
|
|
@ -61,7 +61,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
|
||||
this.transportShardAction = actionName + "/s";
|
||||
this.transportShardAction = actionName + "[s]";
|
||||
this.executor = executor();
|
||||
|
||||
transportService.registerHandler(actionName, new TransportHandler());
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class MultiTermVectorsAction extends ClientAction<MultiTermVectorsRequest, MultiTermVectorsResponse, MultiTermVectorsRequestBuilder> {
|
||||
|
||||
public static final MultiTermVectorsAction INSTANCE = new MultiTermVectorsAction();
|
||||
public static final String NAME = "mtv";
|
||||
public static final String NAME = "indices:data/read/mtv";
|
||||
|
||||
private MultiTermVectorsAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class TermVectorAction extends ClientAction<TermVectorRequest, TermVectorResponse, TermVectorRequestBuilder> {
|
||||
|
||||
public static final TermVectorAction INSTANCE = new TermVectorAction();
|
||||
public static final String NAME = "tv";
|
||||
public static final String NAME = "indices:data/read/tv";
|
||||
|
||||
private TermVectorAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TransportSingleShardMultiTermsVectorAction extends TransportShardSi
|
|||
|
||||
private final IndicesService indicesService;
|
||||
|
||||
private static final String ACTION_NAME = MultiTermVectorsAction.NAME + "/shard";
|
||||
private static final String ACTION_NAME = MultiTermVectorsAction.NAME + "[shard]";
|
||||
|
||||
@Inject
|
||||
public TransportSingleShardMultiTermsVectorAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.client.Client;
|
|||
public class UpdateAction extends ClientAction<UpdateRequest, UpdateResponse, UpdateRequestBuilder> {
|
||||
|
||||
public static final UpdateAction INSTANCE = new UpdateAction();
|
||||
public static final String NAME = "update";
|
||||
public static final String NAME = "indices:data/write/update";
|
||||
|
||||
private UpdateAction() {
|
||||
super(NAME);
|
||||
|
|
|
@ -397,7 +397,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
|||
if (!transportService.nodeConnected(listedNode)) {
|
||||
try {
|
||||
|
||||
// if its one of hte actual nodes we will talk to, not to listed nodes, fully connect
|
||||
// if its one of the actual nodes we will talk to, not to listed nodes, fully connect
|
||||
if (nodes.contains(listedNode)) {
|
||||
logger.trace("connecting to cluster node [{}]", listedNode);
|
||||
transportService.connectToNode(listedNode);
|
||||
|
|
|
@ -67,8 +67,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
public class MappingUpdatedAction extends TransportMasterNodeOperationAction<MappingUpdatedAction.MappingUpdatedRequest, MappingUpdatedAction.MappingUpdatedResponse> {
|
||||
|
||||
public static final String INDICES_MAPPING_ADDITIONAL_MAPPING_CHANGE_TIME = "indices.mapping.additional_mapping_change_time";
|
||||
|
||||
private static final String ACTION_NAME = "cluster/mappingUpdated";
|
||||
public static final String ACTION_NAME = "internal:cluster/mapping_updated";
|
||||
|
||||
private final AtomicLong mappingUpdateOrderGen = new AtomicLong();
|
||||
private final MetaDataMappingService metaDataMappingService;
|
||||
|
|
|
@ -39,6 +39,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
*/
|
||||
public class NodeIndexDeletedAction extends AbstractComponent {
|
||||
|
||||
public static final String INDEX_DELETED_ACTION_NAME = "internal:cluster/node/index/deleted";
|
||||
public static final String INDEX_STORE_DELETED_ACTION_NAME = "internal:cluster/node/index_store/deleted";
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final TransportService transportService;
|
||||
private final List<Listener> listeners = new CopyOnWriteArrayList<>();
|
||||
|
@ -48,8 +51,8 @@ public class NodeIndexDeletedAction extends AbstractComponent {
|
|||
super(settings);
|
||||
this.threadPool = threadPool;
|
||||
this.transportService = transportService;
|
||||
transportService.registerHandler(NodeIndexDeletedTransportHandler.ACTION, new NodeIndexDeletedTransportHandler());
|
||||
transportService.registerHandler(NodeIndexStoreDeletedTransportHandler.ACTION, new NodeIndexStoreDeletedTransportHandler());
|
||||
transportService.registerHandler(INDEX_DELETED_ACTION_NAME, new NodeIndexDeletedTransportHandler());
|
||||
transportService.registerHandler(INDEX_STORE_DELETED_ACTION_NAME, new NodeIndexStoreDeletedTransportHandler());
|
||||
}
|
||||
|
||||
public void add(Listener listener) {
|
||||
|
@ -71,7 +74,7 @@ public class NodeIndexDeletedAction extends AbstractComponent {
|
|||
});
|
||||
} else {
|
||||
transportService.sendRequest(clusterState.nodes().masterNode(),
|
||||
NodeIndexDeletedTransportHandler.ACTION, new NodeIndexDeletedMessage(index, nodeId), EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
INDEX_DELETED_ACTION_NAME, new NodeIndexDeletedMessage(index, nodeId), EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +89,7 @@ public class NodeIndexDeletedAction extends AbstractComponent {
|
|||
});
|
||||
} else {
|
||||
transportService.sendRequest(clusterState.nodes().masterNode(),
|
||||
NodeIndexStoreDeletedTransportHandler.ACTION, new NodeIndexStoreDeletedMessage(index, nodeId), EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
INDEX_STORE_DELETED_ACTION_NAME, new NodeIndexStoreDeletedMessage(index, nodeId), EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,8 +113,6 @@ public class NodeIndexDeletedAction extends AbstractComponent {
|
|||
|
||||
private class NodeIndexDeletedTransportHandler extends BaseTransportRequestHandler<NodeIndexDeletedMessage> {
|
||||
|
||||
static final String ACTION = "cluster/nodeIndexDeleted";
|
||||
|
||||
@Override
|
||||
public NodeIndexDeletedMessage newInstance() {
|
||||
return new NodeIndexDeletedMessage();
|
||||
|
@ -131,8 +132,6 @@ public class NodeIndexDeletedAction extends AbstractComponent {
|
|||
|
||||
private class NodeIndexStoreDeletedTransportHandler extends BaseTransportRequestHandler<NodeIndexStoreDeletedMessage> {
|
||||
|
||||
static final String ACTION = "cluster/nodeIndexStoreDeleted";
|
||||
|
||||
@Override
|
||||
public NodeIndexStoreDeletedMessage newInstance() {
|
||||
return new NodeIndexStoreDeletedMessage();
|
||||
|
|
|
@ -41,6 +41,8 @@ import java.io.IOException;
|
|||
*/
|
||||
public class NodeMappingRefreshAction extends AbstractComponent {
|
||||
|
||||
public static final String ACTION_NAME = "internal:cluster/node/mapping/refresh";
|
||||
|
||||
private final TransportService transportService;
|
||||
private final MetaDataMappingService metaDataMappingService;
|
||||
|
||||
|
@ -49,7 +51,7 @@ public class NodeMappingRefreshAction extends AbstractComponent {
|
|||
super(settings);
|
||||
this.transportService = transportService;
|
||||
this.metaDataMappingService = metaDataMappingService;
|
||||
transportService.registerHandler(NodeMappingRefreshTransportHandler.ACTION, new NodeMappingRefreshTransportHandler());
|
||||
transportService.registerHandler(ACTION_NAME, new NodeMappingRefreshTransportHandler());
|
||||
}
|
||||
|
||||
public void nodeMappingRefresh(final ClusterState state, final NodeMappingRefreshRequest request) throws ElasticsearchException {
|
||||
|
@ -58,7 +60,7 @@ public class NodeMappingRefreshAction extends AbstractComponent {
|
|||
innerMappingRefresh(request);
|
||||
} else {
|
||||
transportService.sendRequest(state.nodes().masterNode(),
|
||||
NodeMappingRefreshTransportHandler.ACTION, request, EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
ACTION_NAME, request, EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,8 +70,6 @@ public class NodeMappingRefreshAction extends AbstractComponent {
|
|||
|
||||
private class NodeMappingRefreshTransportHandler extends BaseTransportRequestHandler<NodeMappingRefreshRequest> {
|
||||
|
||||
static final String ACTION = "cluster/nodeMappingRefresh";
|
||||
|
||||
@Override
|
||||
public NodeMappingRefreshRequest newInstance() {
|
||||
return new NodeMappingRefreshRequest();
|
||||
|
|
|
@ -54,6 +54,9 @@ import static org.elasticsearch.cluster.routing.ImmutableShardRouting.readShardR
|
|||
*/
|
||||
public class ShardStateAction extends AbstractComponent {
|
||||
|
||||
public static final String SHARD_STARTED_ACTION_NAME = "internal:cluster/shard/failure";
|
||||
public static final String SHARD_FAILED_ACTION_NAME = "internal:cluster/shard/started";
|
||||
|
||||
private final TransportService transportService;
|
||||
private final ClusterService clusterService;
|
||||
private final AllocationService allocationService;
|
||||
|
@ -71,8 +74,8 @@ public class ShardStateAction extends AbstractComponent {
|
|||
this.allocationService = allocationService;
|
||||
this.threadPool = threadPool;
|
||||
|
||||
transportService.registerHandler(ShardStartedTransportHandler.ACTION, new ShardStartedTransportHandler());
|
||||
transportService.registerHandler(ShardFailedTransportHandler.ACTION, new ShardFailedTransportHandler());
|
||||
transportService.registerHandler(SHARD_STARTED_ACTION_NAME, new ShardStartedTransportHandler());
|
||||
transportService.registerHandler(SHARD_FAILED_ACTION_NAME, new ShardFailedTransportHandler());
|
||||
}
|
||||
|
||||
public void shardFailed(final ShardRouting shardRouting, final String indexUUID, final String reason) throws ElasticsearchException {
|
||||
|
@ -100,7 +103,7 @@ public class ShardStateAction extends AbstractComponent {
|
|||
innerShardFailed(shardRoutingEntry);
|
||||
} else {
|
||||
transportService.sendRequest(masterNode,
|
||||
ShardFailedTransportHandler.ACTION, shardRoutingEntry, new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
SHARD_FAILED_ACTION_NAME, shardRoutingEntry, new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleException(TransportException exp) {
|
||||
logger.warn("failed to send failed shard to {}", exp, masterNode);
|
||||
|
@ -128,7 +131,7 @@ public class ShardStateAction extends AbstractComponent {
|
|||
innerShardStarted(shardRoutingEntry);
|
||||
} else {
|
||||
transportService.sendRequest(masterNode,
|
||||
ShardStartedTransportHandler.ACTION, new ShardRoutingEntry(shardRouting, indexUUID, reason), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
SHARD_STARTED_ACTION_NAME, new ShardRoutingEntry(shardRouting, indexUUID, reason), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleException(TransportException exp) {
|
||||
logger.warn("failed to send shard started to [{}]", exp, masterNode);
|
||||
|
@ -291,8 +294,6 @@ public class ShardStateAction extends AbstractComponent {
|
|||
|
||||
private class ShardFailedTransportHandler extends BaseTransportRequestHandler<ShardRoutingEntry> {
|
||||
|
||||
static final String ACTION = "cluster/shardFailure";
|
||||
|
||||
@Override
|
||||
public ShardRoutingEntry newInstance() {
|
||||
return new ShardRoutingEntry();
|
||||
|
@ -312,8 +313,6 @@ public class ShardStateAction extends AbstractComponent {
|
|||
|
||||
class ShardStartedTransportHandler extends BaseTransportRequestHandler<ShardRoutingEntry> {
|
||||
|
||||
static final String ACTION = "cluster/shardStarted";
|
||||
|
||||
@Override
|
||||
public ShardRoutingEntry newInstance() {
|
||||
return new ShardRoutingEntry();
|
||||
|
|
|
@ -78,6 +78,8 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
|
|||
*/
|
||||
public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implements Discovery, DiscoveryNodesProvider {
|
||||
|
||||
public static final String DISCOVERY_REJOIN_ACTION_NAME = "internal:discovery/zen/rejoin";
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final TransportService transportService;
|
||||
private final ClusterService clusterService;
|
||||
|
@ -156,7 +158,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
this.pingService.setNodesProvider(this);
|
||||
this.membership = new MembershipAction(settings, clusterService, transportService, this, new MembershipListener());
|
||||
|
||||
transportService.registerHandler(RejoinClusterRequestHandler.ACTION, new RejoinClusterRequestHandler());
|
||||
transportService.registerHandler(DISCOVERY_REJOIN_ACTION_NAME, new RejoinClusterRequestHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -570,7 +572,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
// since the network connections are asymmetric, it may be that we received a state but have disconnected from the node
|
||||
// in the past (after a master failure, for example)
|
||||
transportService.connectToNode(newState.nodes().masterNode());
|
||||
transportService.sendRequest(newState.nodes().masterNode(), RejoinClusterRequestHandler.ACTION, new RejoinClusterRequest(currentState.nodes().localNodeId()), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
transportService.sendRequest(newState.nodes().masterNode(), DISCOVERY_REJOIN_ACTION_NAME, new RejoinClusterRequest(currentState.nodes().localNodeId()), new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
|
||||
@Override
|
||||
public void handleException(TransportException exp) {
|
||||
logger.warn("failed to send rejoin request to [{}]", exp, newState.nodes().masterNode());
|
||||
|
@ -946,8 +948,6 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
|
||||
class RejoinClusterRequestHandler extends BaseTransportRequestHandler<RejoinClusterRequest> {
|
||||
|
||||
static final String ACTION = "discovery/zen/rejoin";
|
||||
|
||||
@Override
|
||||
public RejoinClusterRequest newInstance() {
|
||||
return new RejoinClusterRequest();
|
||||
|
|
|
@ -43,6 +43,8 @@ import static org.elasticsearch.transport.TransportRequestOptions.options;
|
|||
*/
|
||||
public class MasterFaultDetection extends AbstractComponent {
|
||||
|
||||
public static final String MASTER_PING_ACTION_NAME = "internal:discovery/zen/fd/master_ping";
|
||||
|
||||
public static interface Listener {
|
||||
|
||||
void onMasterFailure(DiscoveryNode masterNode, String reason);
|
||||
|
@ -102,7 +104,7 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
transportService.addConnectionListener(connectionListener);
|
||||
}
|
||||
|
||||
transportService.registerHandler(MasterPingRequestHandler.ACTION, new MasterPingRequestHandler());
|
||||
transportService.registerHandler(MASTER_PING_ACTION_NAME, new MasterPingRequestHandler());
|
||||
}
|
||||
|
||||
public DiscoveryNode masterNode() {
|
||||
|
@ -182,7 +184,7 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
stop("closing");
|
||||
this.listeners.clear();
|
||||
transportService.removeConnectionListener(connectionListener);
|
||||
transportService.removeHandler(MasterPingRequestHandler.ACTION);
|
||||
transportService.removeHandler(MASTER_PING_ACTION_NAME);
|
||||
}
|
||||
|
||||
private void handleTransportDisconnect(DiscoveryNode node) {
|
||||
|
@ -266,7 +268,7 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
threadPool.schedule(pingInterval, ThreadPool.Names.SAME, MasterPinger.this);
|
||||
return;
|
||||
}
|
||||
transportService.sendRequest(masterToPing, MasterPingRequestHandler.ACTION, new MasterPingRequest(nodesProvider.nodes().localNode().id(), masterToPing.id()), options().withType(TransportRequestOptions.Type.PING).withTimeout(pingRetryTimeout),
|
||||
transportService.sendRequest(masterToPing, MASTER_PING_ACTION_NAME, new MasterPingRequest(nodesProvider.nodes().localNode().id(), masterToPing.id()), options().withType(TransportRequestOptions.Type.PING).withTimeout(pingRetryTimeout),
|
||||
new BaseTransportResponseHandler<MasterPingResponseResponse>() {
|
||||
@Override
|
||||
public MasterPingResponseResponse newInstance() {
|
||||
|
@ -324,7 +326,7 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
notifyMasterFailure(masterToPing, "failed to ping, tried [" + pingRetryCount + "] times, each with maximum [" + pingRetryTimeout + "] timeout");
|
||||
} else {
|
||||
// resend the request, not reschedule, rely on send timeout
|
||||
transportService.sendRequest(masterToPing, MasterPingRequestHandler.ACTION, new MasterPingRequest(nodesProvider.nodes().localNode().id(), masterToPing.id()), options().withType(TransportRequestOptions.Type.PING).withTimeout(pingRetryTimeout), this);
|
||||
transportService.sendRequest(masterToPing, MASTER_PING_ACTION_NAME, new MasterPingRequest(nodesProvider.nodes().localNode().id(), masterToPing.id()), options().withType(TransportRequestOptions.Type.PING).withTimeout(pingRetryTimeout), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,8 +364,6 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
|
||||
private class MasterPingRequestHandler extends BaseTransportRequestHandler<MasterPingRequest> {
|
||||
|
||||
public static final String ACTION = "discovery/zen/fd/masterPing";
|
||||
|
||||
@Override
|
||||
public MasterPingRequest newInstance() {
|
||||
return new MasterPingRequest();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue