nicer main action names

This commit is contained in:
Shay Banon 2012-01-03 01:04:08 +02:00
parent 83d5084f62
commit beb5986256
8 changed files with 27 additions and 38 deletions

View File

@ -24,39 +24,26 @@ package org.elasticsearch.action;
*/ */
public class TransportActions { public class TransportActions {
public static final String BULK = "indices/bulk"; public static final String BULK = "bulk";
public static final String INDEX = "index";
public static final String INDEX = "indices/index/shard/index";
public static final String UPDATE = "update"; public static final String UPDATE = "update";
public static final String COUNT = "count";
public static final String COUNT = "indices/count"; public static final String DELETE = "delete";
public static final String DELETE_BY_QUERY = "deleteByQuery";
public static final String DELETE = "indices/index/shard/delete"; public static final String GET = "get";
public static final String MULTI_GET = "mget";
public static final String DELETE_BY_QUERY = "indices/deleteByQuery"; public static final String SEARCH = "search";
public static final String SEARCH_SCROLL = "searchScroll";
public static final String GET = "indices/get"; public static final String MORE_LIKE_THIS = "mlt";
public static final String PERCOLATE = "percolate";
public static final String MULTI_GET = "indices/mget";
public static final String SEARCH = "indices/search";
public static final String SEARCH_SCROLL = "indices/searchScroll";
public static final String TERMS = "indices/terms";
public static final String MORE_LIKE_THIS = "indices/moreLikeThis";
public static final String PERCOLATE = "indices/percolate";
public static class Admin { public static class Admin {
public static class Indices { public static class Indices {
public static final String CREATE = "indices/createIndex"; public static final String CREATE = "indices/create";
public static final String DELETE = "indices/deleteIndex"; public static final String DELETE = "indices/delete";
public static final String OPEN = "indices/openIndex"; public static final String OPEN = "indices/open";
public static final String CLOSE = "indices/closeIndex"; public static final String CLOSE = "indices/close";
public static final String FLUSH = "indices/flush"; public static final String FLUSH = "indices/flush";
public static final String REFRESH = "indices/refresh"; public static final String REFRESH = "indices/refresh";
public static final String OPTIMIZE = "indices/optimize"; public static final String OPTIMIZE = "indices/optimize";

View File

@ -23,6 +23,7 @@ import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.RoutingMissingException; import org.elasticsearch.action.RoutingMissingException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
@ -102,7 +103,7 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
@Override @Override
protected String transportAction() { protected String transportAction() {
return "indices/index/shard/bulk"; return TransportActions.BULK + "/shard";
} }
@Override @Override

View File

@ -69,7 +69,7 @@ public class TransportCountAction extends TransportBroadcastOperationAction<Coun
@Override @Override
protected String transportShardAction() { protected String transportShardAction() {
return "indices/count/shard"; return TransportActions.COUNT + "/shard";
} }
@Override @Override

View File

@ -19,6 +19,7 @@
package org.elasticsearch.action.deletebyquery; package org.elasticsearch.action.deletebyquery;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.replication.TransportIndexReplicationOperationAction; import org.elasticsearch.action.support.replication.TransportIndexReplicationOperationAction;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -68,7 +69,7 @@ public class TransportIndexDeleteByQueryAction extends TransportIndexReplication
@Override @Override
protected String transportAction() { protected String transportAction() {
return "indices/index/deleteByQuery"; return TransportActions.DELETE_BY_QUERY + "/index";
} }
@Override @Override

View File

@ -20,6 +20,7 @@
package org.elasticsearch.action.deletebyquery; package org.elasticsearch.action.deletebyquery;
import org.elasticsearch.ElasticSearchIllegalStateException; import org.elasticsearch.ElasticSearchIllegalStateException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction; import org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -74,7 +75,7 @@ public class TransportShardDeleteByQueryAction extends TransportShardReplication
@Override @Override
protected String transportAction() { protected String transportAction() {
return "indices/index/shard/deleteByQuery"; return TransportActions.DELETE_BY_QUERY + "/shard";
} }
@Override @Override

View File

@ -40,8 +40,6 @@ import org.elasticsearch.transport.TransportService;
/** /**
* Performs the get operation. * Performs the get operation.
*
*
*/ */
public class TransportGetAction extends TransportShardSingleOperationAction<GetRequest, GetResponse> { public class TransportGetAction extends TransportShardSingleOperationAction<GetRequest, GetResponse> {
@ -70,7 +68,7 @@ public class TransportGetAction extends TransportShardSingleOperationAction<GetR
@Override @Override
protected String transportShardAction() { protected String transportShardAction() {
return "indices/get/shard"; return TransportActions.GET + "/shard";
} }
@Override @Override

View File

@ -22,6 +22,7 @@ package org.elasticsearch.action.get;
import org.elasticsearch.ElasticSearchException; import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction; import org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -63,12 +64,12 @@ public class TransportShardMultiGetAction extends TransportShardSingleOperationA
@Override @Override
protected String transportAction() { protected String transportAction() {
return "indices/mget/shard"; return TransportActions.MULTI_GET + "/shard";
} }
@Override @Override
protected String transportShardAction() { protected String transportShardAction() {
return "indices/mget/shard/s"; return TransportActions.MULTI_GET + "/shard/s";
} }
@Override @Override

View File

@ -70,7 +70,7 @@ public class TransportPercolateAction extends TransportSingleCustomOperationActi
@Override @Override
protected String transportShardAction() { protected String transportShardAction() {
return "indices/percolate/shard"; return TransportActions.PERCOLATE + "/shard";
} }
@Override @Override