Skip to content
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

Better categorization for transport actions #7105

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -47,6 +47,8 @@
*/
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;
Expand All @@ -61,7 +63,7 @@ public TransportNodesShutdownAction(Settings settings, TransportService transpor
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
Expand Down Expand Up @@ -122,7 +124,7 @@ public void run() {
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);
Expand All @@ -146,7 +148,7 @@ public void handleException(TransportException exp) {

// 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");
Expand Down Expand Up @@ -190,7 +192,7 @@ public void run() {
}

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);
Expand Down Expand Up @@ -221,8 +223,6 @@ public void handleException(TransportException exp) {

private class NodeShutdownRequestHandler extends BaseTransportRequestHandler<NodeShutdownRequest> {

static final String ACTION = "/cluster/nodes/shutdown/node";

@Override
public NodeShutdownRequest newInstance() {
return new NodeShutdownRequest();
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -51,7 +51,7 @@
*/
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;

Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -28,7 +28,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -26,7 +26,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -56,7 +56,7 @@
*/
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;
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down
Expand Up @@ -27,7 +27,7 @@
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);
Expand Down