cleanup single operation action support

This commit is contained in:
kimchy 2010-11-20 18:23:13 +02:00
parent 5833a6b9ff
commit 58ecc4f77f
6 changed files with 14 additions and 16 deletions

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.cluster.ping.single;
import org.elasticsearch.action.support.single.SingleOperationRequest;
import org.elasticsearch.action.support.single.shard.SingleOperationRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;

View File

@ -21,21 +21,20 @@ package org.elasticsearch.action.admin.cluster.ping.single;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.single.TransportSingleOperationAction;
import org.elasticsearch.action.support.single.shard.TransportSingleOperationAction;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
* @author kimchy (Shay Banon)
* @author kimchy (shay.banon)
*/
public class TransportSinglePingAction extends TransportSingleOperationAction<SinglePingRequest, SinglePingResponse> {
@Inject public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService, indicesService);
@Inject public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings, threadPool, clusterService, transportService);
}
@Override protected String transportAction() {

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.get;
import org.elasticsearch.action.support.single.SingleOperationRequest;
import org.elasticsearch.action.support.single.shard.SingleOperationRequest;
import org.elasticsearch.common.Required;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;

View File

@ -24,7 +24,7 @@ import org.apache.lucene.document.FieldSelector;
import org.apache.lucene.document.Fieldable;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.single.TransportSingleOperationAction;
import org.elasticsearch.action.support.single.shard.TransportSingleOperationAction;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
@ -52,9 +52,12 @@ import static org.elasticsearch.common.collect.Maps.*;
*/
public class TransportGetAction extends TransportSingleOperationAction<GetRequest, GetResponse> {
private final IndicesService indicesService;
@Inject public TransportGetAction(Settings settings, ClusterService clusterService, TransportService transportService,
IndicesService indicesService, ThreadPool threadPool) {
super(settings, threadPool, clusterService, transportService, indicesService);
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
@Override protected String transportAction() {

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.action.support.single;
package org.elasticsearch.action.support.single.shard;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.action.support.single;
package org.elasticsearch.action.support.single.shard;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.ActionListener;
@ -34,7 +34,6 @@ import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.*;
@ -49,16 +48,13 @@ public abstract class TransportSingleOperationAction<Request extends SingleOpera
protected final TransportService transportService;
protected final IndicesService indicesService;
protected final ThreadPool threadPool;
protected TransportSingleOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
protected TransportSingleOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings);
this.clusterService = clusterService;
this.transportService = transportService;
this.threadPool = threadPool;
this.indicesService = indicesService;
transportService.registerHandler(transportAction(), new TransportHandler());
transportService.registerHandler(transportShardAction(), new ShardTransportHandler());