rename single operation base support to single shard operation

This commit is contained in:
kimchy 2010-11-21 13:26:36 +02:00
parent c40eaaae38
commit a74465000d
6 changed files with 16 additions and 16 deletions

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.cluster.ping.single; package org.elasticsearch.action.admin.cluster.ping.single;
import org.elasticsearch.action.support.single.shard.SingleOperationRequest; import org.elasticsearch.action.support.single.shard.SingleShardOperationRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -28,7 +28,7 @@ import java.io.IOException;
/** /**
* @author kimchy (Shay Banon) * @author kimchy (Shay Banon)
*/ */
public class SinglePingRequest extends SingleOperationRequest { public class SinglePingRequest extends SingleShardOperationRequest {
public SinglePingRequest(String index) { public SinglePingRequest(String index) {
super(index, null, null); super(index, null, null);

View File

@ -21,7 +21,7 @@ package org.elasticsearch.action.admin.cluster.ping.single;
import org.elasticsearch.ElasticSearchException; import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions; import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.single.shard.TransportSingleOperationAction; import org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
@ -31,7 +31,7 @@ import org.elasticsearch.transport.TransportService;
/** /**
* @author kimchy (shay.banon) * @author kimchy (shay.banon)
*/ */
public class TransportSinglePingAction extends TransportSingleOperationAction<SinglePingRequest, SinglePingResponse> { public class TransportSinglePingAction extends TransportShardSingleOperationAction<SinglePingRequest, SinglePingResponse> {
@Inject public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) { @Inject public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings, threadPool, clusterService, transportService); super(settings, threadPool, clusterService, transportService);

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.get; package org.elasticsearch.action.get;
import org.elasticsearch.action.support.single.shard.SingleOperationRequest; import org.elasticsearch.action.support.single.shard.SingleShardOperationRequest;
import org.elasticsearch.common.Required; import org.elasticsearch.common.Required;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -38,7 +38,7 @@ import java.io.IOException;
* @see org.elasticsearch.client.Requests#getRequest(String) * @see org.elasticsearch.client.Requests#getRequest(String)
* @see org.elasticsearch.client.Client#get(GetRequest) * @see org.elasticsearch.client.Client#get(GetRequest)
*/ */
public class GetRequest extends SingleOperationRequest { public class GetRequest extends SingleShardOperationRequest {
private String[] fields; private String[] fields;

View File

@ -24,7 +24,7 @@ import org.apache.lucene.document.FieldSelector;
import org.apache.lucene.document.Fieldable; import org.apache.lucene.document.Fieldable;
import org.elasticsearch.ElasticSearchException; import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions; import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.single.shard.TransportSingleOperationAction; 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;
import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.block.ClusterBlockLevel;
@ -50,7 +50,7 @@ import static org.elasticsearch.common.collect.Maps.*;
* *
* @author kimchy (shay.banon) * @author kimchy (shay.banon)
*/ */
public class TransportGetAction extends TransportSingleOperationAction<GetRequest, GetResponse> { public class TransportGetAction extends TransportShardSingleOperationAction<GetRequest, GetResponse> {
private final IndicesService indicesService; private final IndicesService indicesService;

View File

@ -30,7 +30,7 @@ import java.io.IOException;
/** /**
* @author kimchy (shay.banon) * @author kimchy (shay.banon)
*/ */
public abstract class SingleOperationRequest implements ActionRequest { public abstract class SingleShardOperationRequest implements ActionRequest {
protected String index; protected String index;
protected String type; protected String type;
@ -40,10 +40,10 @@ public abstract class SingleOperationRequest implements ActionRequest {
private boolean threadedListener = false; private boolean threadedListener = false;
private boolean threadedOperation = true; private boolean threadedOperation = true;
protected SingleOperationRequest() { protected SingleShardOperationRequest() {
} }
public SingleOperationRequest(String index, String type, String id) { public SingleShardOperationRequest(String index, String type, String id) {
this.index = index; this.index = index;
this.type = type; this.type = type;
this.id = id; this.id = id;
@ -67,7 +67,7 @@ public abstract class SingleOperationRequest implements ActionRequest {
return index; return index;
} }
SingleOperationRequest index(String index) { SingleShardOperationRequest index(String index) {
this.index = index; this.index = index;
return this; return this;
} }
@ -91,7 +91,7 @@ public abstract class SingleOperationRequest implements ActionRequest {
return threadedListener; return threadedListener;
} }
@Override public SingleOperationRequest listenerThreaded(boolean threadedListener) { @Override public SingleShardOperationRequest listenerThreaded(boolean threadedListener) {
this.threadedListener = threadedListener; this.threadedListener = threadedListener;
return this; return this;
} }
@ -106,7 +106,7 @@ public abstract class SingleOperationRequest implements ActionRequest {
/** /**
* Controls if the operation will be executed on a separate thread when executed locally. * Controls if the operation will be executed on a separate thread when executed locally.
*/ */
public SingleOperationRequest operationThreaded(boolean threadedOperation) { public SingleShardOperationRequest operationThreaded(boolean threadedOperation) {
this.threadedOperation = threadedOperation; this.threadedOperation = threadedOperation;
return this; return this;
} }

View File

@ -42,7 +42,7 @@ import java.io.IOException;
/** /**
* @author kimchy (shay.banon) * @author kimchy (shay.banon)
*/ */
public abstract class TransportSingleOperationAction<Request extends SingleOperationRequest, Response extends ActionResponse> extends BaseAction<Request, Response> { public abstract class TransportShardSingleOperationAction<Request extends SingleShardOperationRequest, Response extends ActionResponse> extends BaseAction<Request, Response> {
protected final ClusterService clusterService; protected final ClusterService clusterService;
@ -50,7 +50,7 @@ public abstract class TransportSingleOperationAction<Request extends SingleOpera
protected final ThreadPool threadPool; protected final ThreadPool threadPool;
protected TransportSingleOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) { protected TransportShardSingleOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings); super(settings);
this.clusterService = clusterService; this.clusterService = clusterService;
this.transportService = transportService; this.transportService = transportService;