Remove unused / obsolete import and throws statements
This commit removes unused thorws statements when RuntimeExceptions are mentioned in the throws statement. It also removes obsolete import statements for java.lang.IllegalArgumentException and java.lang.IllegalStateException
This commit is contained in:
parent
4f14af21c5
commit
b4efb6c472
|
@ -21,7 +21,6 @@ package org.apache.lucene.analysis;
|
|||
|
||||
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
|
||||
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.apache.lucene.store;
|
||||
|
||||
import org.apache.lucene.store.RateLimiter.SimpleRateLimiter;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
|
||||
|
@ -42,7 +41,7 @@ public class StoreRateLimiting {
|
|||
MERGE,
|
||||
ALL;
|
||||
|
||||
public static Type fromString(String type) throws IllegalArgumentException {
|
||||
public static Type fromString(String type) {
|
||||
if ("none".equalsIgnoreCase(type)) {
|
||||
return NONE;
|
||||
} else if ("merge".equalsIgnoreCase(type)) {
|
||||
|
@ -88,7 +87,7 @@ public class StoreRateLimiting {
|
|||
this.type = type;
|
||||
}
|
||||
|
||||
public void setType(String type) throws IllegalArgumentException {
|
||||
public void setType(String type) {
|
||||
this.type = Type.fromString(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public interface ActionFuture<T> extends Future<T> {
|
|||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
||||
* still accessible using {@link #getRootFailure()}.
|
||||
*/
|
||||
T actionGet() throws ElasticsearchException;
|
||||
T actionGet();
|
||||
|
||||
/**
|
||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||
|
@ -53,7 +53,7 @@ public interface ActionFuture<T> extends Future<T> {
|
|||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
||||
* still accessible using {@link #getRootFailure()}.
|
||||
*/
|
||||
T actionGet(String timeout) throws ElasticsearchException;
|
||||
T actionGet(String timeout);
|
||||
|
||||
/**
|
||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||
|
@ -66,7 +66,7 @@ public interface ActionFuture<T> extends Future<T> {
|
|||
*
|
||||
* @param timeoutMillis Timeout in millis
|
||||
*/
|
||||
T actionGet(long timeoutMillis) throws ElasticsearchException;
|
||||
T actionGet(long timeoutMillis);
|
||||
|
||||
/**
|
||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||
|
@ -77,7 +77,7 @@ public interface ActionFuture<T> extends Future<T> {
|
|||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
||||
* still accessible using {@link #getRootFailure()}.
|
||||
*/
|
||||
T actionGet(long timeout, TimeUnit unit) throws ElasticsearchException;
|
||||
T actionGet(long timeout, TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||
|
@ -88,7 +88,7 @@ public interface ActionFuture<T> extends Future<T> {
|
|||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
||||
* still accessible using {@link #getRootFailure()}.
|
||||
*/
|
||||
T actionGet(TimeValue timeout) throws ElasticsearchException;
|
||||
T actionGet(TimeValue timeout);
|
||||
|
||||
/**
|
||||
* The root (possibly) wrapped failure.
|
||||
|
|
|
@ -69,21 +69,21 @@ public abstract class ActionRequestBuilder<Request extends ActionRequest, Respon
|
|||
/**
|
||||
* Short version of execute().actionGet().
|
||||
*/
|
||||
public Response get() throws ElasticsearchException {
|
||||
public Response get() {
|
||||
return execute().actionGet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Short version of execute().actionGet().
|
||||
*/
|
||||
public Response get(TimeValue timeout) throws ElasticsearchException {
|
||||
public Response get(TimeValue timeout) {
|
||||
return execute().actionGet(timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Short version of execute().actionGet().
|
||||
*/
|
||||
public Response get(String timeout) throws ElasticsearchException {
|
||||
public Response get(String timeout) {
|
||||
return execute().actionGet(timeout);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.action;
|
|||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Write Consistency Level control how many replicas should be active for a write operation to occur (a write operation
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.health;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.admin.cluster.health;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
@ -66,7 +65,7 @@ public class TransportClusterHealthAction extends TransportMasterNodeReadOperati
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final ClusterHealthRequest request, final ClusterState unusedState, final ActionListener<ClusterHealthResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final ClusterHealthRequest request, final ClusterState unusedState, final ActionListener<ClusterHealthResponse> listener) {
|
||||
if (request.waitForEvents() != null) {
|
||||
final long endTime = System.currentTimeMillis() + request.timeout().millis();
|
||||
clusterService.submitStateUpdateTask("cluster_health (wait_for_events [" + request.waitForEvents() + "])", request.waitForEvents(), new ProcessedClusterStateUpdateTask() {
|
||||
|
|
|
@ -73,7 +73,7 @@ public class TransportNodesHotThreadsAction extends TransportNodesOperationActio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodeHotThreads nodeOperation(NodeRequest request) throws ElasticsearchException {
|
||||
protected NodeHotThreads nodeOperation(NodeRequest request) {
|
||||
HotThreads hotThreads = new HotThreads()
|
||||
.busiestThreads(request.request.threads)
|
||||
.type(request.request.type)
|
||||
|
|
|
@ -77,7 +77,7 @@ public class TransportNodesInfoAction extends TransportNodesOperationAction<Node
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodeInfo nodeOperation(NodeInfoRequest nodeRequest) throws ElasticsearchException {
|
||||
protected NodeInfo nodeOperation(NodeInfoRequest nodeRequest) {
|
||||
NodesInfoRequest request = nodeRequest.request;
|
||||
return nodeService.info(request.settings(), request.os(), request.process(), request.jvm(), request.threadPool(),
|
||||
request.network(), request.transport(), request.http(), request.plugins());
|
||||
|
|
|
@ -77,7 +77,7 @@ public class TransportNodesStatsAction extends TransportNodesOperationAction<Nod
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest) throws ElasticsearchException {
|
||||
protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest) {
|
||||
NodesStatsRequest request = nodeStatsRequest.request;
|
||||
return nodeService.stats(request.indices(), request.os(), request.process(), request.jvm(), request.threadPool(), request.network(),
|
||||
request.fs(), request.transport(), request.http(), request.breaker());
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state, final ActionListener<DeleteRepositoryResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state, final ActionListener<DeleteRepositoryResponse> listener) {
|
||||
repositoriesService.unregisterRepository(
|
||||
new RepositoriesService.UnregisterRepositoryRequest("delete_repository [" + request.name() + "]", request.name())
|
||||
.masterNodeTimeout(request.masterNodeTimeout()).ackTimeout(request.timeout()),
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportGetRepositoriesAction extends TransportMasterNodeReadOpera
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final GetRepositoriesRequest request, ClusterState state, final ActionListener<GetRepositoriesResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final GetRepositoriesRequest request, ClusterState state, final ActionListener<GetRepositoriesResponse> listener) {
|
||||
MetaData metaData = state.metaData();
|
||||
RepositoriesMetaData repositories = metaData.custom(RepositoriesMetaData.TYPE);
|
||||
if (request.repositories().length == 0 || (request.repositories().length == 1 && "_all".equals(request.repositories()[0]))) {
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.admin.cluster.repositories.put;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportPutRepositoryAction extends TransportMasterNodeOperationAc
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final PutRepositoryRequest request, ClusterState state, final ActionListener<PutRepositoryResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final PutRepositoryRequest request, ClusterState state, final ActionListener<PutRepositoryResponse> listener) {
|
||||
|
||||
repositoriesService.registerRepository(
|
||||
new RepositoriesService.RegisterRepositoryRequest("put_repository [" + request.name() + "]",
|
||||
|
|
|
@ -68,7 +68,7 @@ public class TransportVerifyRepositoryAction extends TransportMasterNodeOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final VerifyRepositoryRequest request, ClusterState state, final ActionListener<VerifyRepositoryResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final VerifyRepositoryRequest request, ClusterState state, final ActionListener<VerifyRepositoryResponse> listener) {
|
||||
repositoriesService.verifyRepository(request.name(), new ActionListener<RepositoriesService.VerifyResponse>() {
|
||||
@Override
|
||||
public void onResponse(RepositoriesService.VerifyResponse verifyResponse) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class TransportClusterRerouteAction extends TransportMasterNodeOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final ClusterRerouteRequest request, final ClusterState state, final ActionListener<ClusterRerouteResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final ClusterRerouteRequest request, final ClusterState state, final ActionListener<ClusterRerouteResponse> listener) {
|
||||
clusterService.submitStateUpdateTask("cluster_reroute (api)", Priority.IMMEDIATE, new AckedClusterStateUpdateTask<ClusterRerouteResponse>(request, listener) {
|
||||
|
||||
private volatile ClusterState clusterStateToSend;
|
||||
|
|
|
@ -86,7 +86,7 @@ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeOpe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final ClusterUpdateSettingsRequest request, final ClusterState state, final ActionListener<ClusterUpdateSettingsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final ClusterUpdateSettingsRequest request, final ClusterState state, final ActionListener<ClusterUpdateSettingsResponse> listener) {
|
||||
final ImmutableSettings.Builder transientUpdates = ImmutableSettings.settingsBuilder();
|
||||
final ImmutableSettings.Builder persistentUpdates = ImmutableSettings.settingsBuilder();
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.shards;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
|
|
@ -67,7 +67,7 @@ public class TransportClusterSearchShardsAction extends TransportMasterNodeReadO
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) {
|
||||
ClusterState clusterState = clusterService.state();
|
||||
String[] concreteIndices = clusterState.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
Map<String, Set<String>> routingMap = clusterState.metaData().resolveSearchRouting(request.routing(), request.indices());
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.admin.cluster.snapshots.create;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportCreateSnapshotAction extends TransportMasterNodeOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final CreateSnapshotRequest request, ClusterState state, final ActionListener<CreateSnapshotResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final CreateSnapshotRequest request, ClusterState state, final ActionListener<CreateSnapshotResponse> listener) {
|
||||
SnapshotsService.SnapshotRequest snapshotRequest =
|
||||
new SnapshotsService.SnapshotRequest("create_snapshot[" + request.snapshot() + "]", request.snapshot(), request.repository())
|
||||
.indices(request.indices())
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TransportDeleteSnapshotAction extends TransportMasterNodeOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<DeleteSnapshotResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<DeleteSnapshotResponse> listener) {
|
||||
SnapshotId snapshotIds = new SnapshotId(request.repository(), request.snapshot());
|
||||
snapshotsService.deleteSnapshot(snapshotIds, new SnapshotsService.DeleteSnapshotListener() {
|
||||
@Override
|
||||
|
|
|
@ -66,7 +66,7 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeOperationAct
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final GetSnapshotsRequest request, ClusterState state, final ActionListener<GetSnapshotsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final GetSnapshotsRequest request, ClusterState state, final ActionListener<GetSnapshotsResponse> listener) {
|
||||
try {
|
||||
ImmutableList.Builder<SnapshotInfo> snapshotInfoBuilder = ImmutableList.builder();
|
||||
if (isAllSnapshots(request.snapshots())) {
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.admin.cluster.snapshots.restore;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class TransportRestoreSnapshotAction extends TransportMasterNodeOperation
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final RestoreSnapshotRequest request, ClusterState state, final ActionListener<RestoreSnapshotResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final RestoreSnapshotRequest request, ClusterState state, final ActionListener<RestoreSnapshotResponse> listener) {
|
||||
RestoreService.RestoreRequest restoreRequest = new RestoreService.RestoreRequest(
|
||||
"restore_snapshot[" + request.snapshot() + "]", request.repository(), request.snapshot(),
|
||||
request.indices(), request.indicesOptions(), request.renamePattern(), request.renameReplacement(),
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.support.broadcast.BroadcastShardOperationResponse;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
||||
|
|
|
@ -94,7 +94,7 @@ public class TransportNodesSnapshotsStatus extends TransportNodesOperationAction
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodeSnapshotStatus nodeOperation(NodeRequest request) throws ElasticsearchException {
|
||||
protected NodeSnapshotStatus nodeOperation(NodeRequest request) {
|
||||
ImmutableMap.Builder<SnapshotId, ImmutableMap<ShardId, SnapshotIndexShardStatus>> snapshotMapBuilder = ImmutableMap.builder();
|
||||
try {
|
||||
String nodeId = clusterService.localNode().id();
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.action.admin.cluster.snapshots.status;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.master.TransportMasterNodeOperationAction;
|
||||
|
|
|
@ -79,7 +79,7 @@ public class TransportClusterStateAction extends TransportMasterNodeReadOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final ClusterStateRequest request, final ClusterState state, ActionListener<ClusterStateResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final ClusterStateRequest request, final ClusterState state, ActionListener<ClusterStateResponse> listener) {
|
||||
ClusterState currentState = clusterService.state();
|
||||
logger.trace("Serving cluster state request using version {}", currentState.version());
|
||||
ClusterState.Builder builder = ClusterState.builder(currentState.getClusterName());
|
||||
|
|
|
@ -97,7 +97,7 @@ public class TransportClusterStatsAction extends TransportNodesOperationAction<C
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ClusterStatsNodeResponse nodeOperation(ClusterStatsNodeRequest nodeRequest) throws ElasticsearchException {
|
||||
protected ClusterStatsNodeResponse nodeOperation(ClusterStatsNodeRequest nodeRequest) {
|
||||
NodeInfo nodeInfo = nodeService.info(false, true, false, true, false, false, true, false, true);
|
||||
NodeStats nodeStats = nodeService.stats(CommonStatsFlags.NONE, false, true, true, false, false, true, false, false, false);
|
||||
List<ShardStats> shardsStats = new ArrayList<>();
|
||||
|
|
|
@ -62,7 +62,7 @@ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadO
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(PendingClusterTasksRequest request, ClusterState state, ActionListener<PendingClusterTasksResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(PendingClusterTasksRequest request, ClusterState state, ActionListener<PendingClusterTasksResponse> listener) {
|
||||
listener.onResponse(new PendingClusterTasksResponse(clusterService.pendingTasks()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.admin.indices.alias;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
|
|
@ -77,7 +77,7 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final IndicesAliasesRequest request, final ClusterState state, final ActionListener<IndicesAliasesResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final IndicesAliasesRequest request, final ClusterState state, final ActionListener<IndicesAliasesResponse> listener) {
|
||||
|
||||
//Expand the indices names
|
||||
List<AliasActions> actions = request.aliasActions();
|
||||
|
|
|
@ -58,7 +58,7 @@ public class TransportAliasesExistAction extends TransportMasterNodeReadOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<AliasesExistResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<AliasesExistResponse> listener) {
|
||||
String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
boolean result = state.metaData().hasAliases(request.aliases(), concreteIndices);
|
||||
listener.onResponse(new AliasesExistResponse(result));
|
||||
|
|
|
@ -61,7 +61,7 @@ public class TransportGetAliasesAction extends TransportMasterNodeReadOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) {
|
||||
String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
@SuppressWarnings("unchecked") // ImmutableList to List results incompatible type
|
||||
ImmutableOpenMap<String, List<AliasMetaData>> result = (ImmutableOpenMap) state.metaData().findAliases(request.aliases(), concreteIndices);
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
|
|||
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
|
||||
import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.single.custom.TransportSingleCustomOperationAction;
|
||||
|
@ -97,7 +96,7 @@ public class TransportAnalyzeAction extends TransportSingleCustomOperationAction
|
|||
}
|
||||
|
||||
@Override
|
||||
protected AnalyzeResponse shardOperation(AnalyzeRequest request, ShardId shardId) throws ElasticsearchException {
|
||||
protected AnalyzeResponse shardOperation(AnalyzeRequest request, ShardId shardId) {
|
||||
IndexService indexService = null;
|
||||
if (shardId != null) {
|
||||
indexService = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
|
|
|
@ -97,7 +97,7 @@ public class TransportClearIndicesCacheAction extends TransportBroadcastOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardClearIndicesCacheResponse shardOperation(ShardClearIndicesCacheRequest request) throws ElasticsearchException {
|
||||
protected ShardClearIndicesCacheResponse shardOperation(ShardClearIndicesCacheRequest request) {
|
||||
IndexService service = indicesService.indexService(request.shardId().getIndex());
|
||||
if (service != null) {
|
||||
IndexShard shard = service.shard(request.shardId().id());
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeOperationActio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<CloseIndexResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<CloseIndexResponse> listener) {
|
||||
final String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
CloseIndexClusterStateUpdateRequest updateRequest = new CloseIndexClusterStateUpdateRequest()
|
||||
.ackTimeout(request.timeout()).masterNodeTimeout(request.masterNodeTimeout())
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.action.admin.indices.create;
|
|||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
|
|
|
@ -66,7 +66,7 @@ public class TransportCreateIndexAction extends TransportMasterNodeOperationActi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final CreateIndexRequest request, final ClusterState state, final ActionListener<CreateIndexResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final CreateIndexRequest request, final ClusterState state, final ActionListener<CreateIndexResponse> listener) {
|
||||
String cause = request.cause();
|
||||
if (cause.length() == 0) {
|
||||
cause = "api";
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final DeleteIndexRequest request, final ClusterState state, final ActionListener<DeleteIndexResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final DeleteIndexRequest request, final ClusterState state, final ActionListener<DeleteIndexResponse> listener) {
|
||||
String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
if (concreteIndices.length == 0) {
|
||||
listener.onResponse(new DeleteIndexResponse(true));
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportIndicesExistsAction extends TransportMasterNodeReadOperati
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final IndicesExistsRequest request, final ClusterState state, final ActionListener<IndicesExistsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final IndicesExistsRequest request, final ClusterState state, final ActionListener<IndicesExistsResponse> listener) {
|
||||
boolean exists;
|
||||
try {
|
||||
// Similar as the previous behaviour, but now also aliases and wildcards are supported.
|
||||
|
|
|
@ -61,7 +61,7 @@ public class TransportTypesExistsAction extends TransportMasterNodeReadOperation
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final TypesExistsRequest request, final ClusterState state, final ActionListener<TypesExistsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final TypesExistsRequest request, final ClusterState state, final ActionListener<TypesExistsResponse> listener) {
|
||||
String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
if (concreteIndices.length == 0) {
|
||||
listener.onResponse(new TypesExistsResponse(false));
|
||||
|
|
|
@ -90,7 +90,7 @@ public class TransportFlushAction extends TransportBroadcastOperationAction<Flus
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardFlushResponse shardOperation(ShardFlushRequest request) throws ElasticsearchException {
|
||||
protected ShardFlushResponse shardOperation(ShardFlushRequest request) {
|
||||
IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id());
|
||||
indexShard.flush(request.getRequest());
|
||||
return new ShardFlushResponse(request.shardId());
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.action.admin.indices.get;
|
|||
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.support.master.info.ClusterInfoRequest;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
|
@ -74,7 +73,7 @@ public class GetIndexRequest extends ClusterInfoRequest<GetIndexRequest> {
|
|||
return this.validNames.contains(name);
|
||||
}
|
||||
|
||||
public static Feature fromName(String name) throws IllegalArgumentException {
|
||||
public static Feature fromName(String name) {
|
||||
for (Feature feature : Feature.values()) {
|
||||
if (feature.validName(name)) {
|
||||
return feature;
|
||||
|
@ -83,7 +82,7 @@ public class GetIndexRequest extends ClusterInfoRequest<GetIndexRequest> {
|
|||
throw new IllegalArgumentException("No feature for name [" + name + "]");
|
||||
}
|
||||
|
||||
public static Feature fromId(byte id) throws IllegalArgumentException {
|
||||
public static Feature fromId(byte id) {
|
||||
if (id < 0 || id >= FEATURES.length) {
|
||||
throw new IllegalArgumentException("No mapping for id [" + id + "]");
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.action.admin.indices.get;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
|
@ -70,7 +69,7 @@ public class TransportGetIndexAction extends TransportClusterInfoAction<GetIndex
|
|||
|
||||
@Override
|
||||
protected void doMasterOperation(final GetIndexRequest request, String[] concreteIndices, final ClusterState state,
|
||||
final ActionListener<GetIndexResponse> listener) throws ElasticsearchException {
|
||||
final ActionListener<GetIndexResponse> listener) {
|
||||
ImmutableOpenMap<String, ImmutableList<Entry>> warmersResult = ImmutableOpenMap.of();
|
||||
ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappingsResult = ImmutableOpenMap.of();
|
||||
ImmutableOpenMap<String, ImmutableList<AliasMetaData>> aliasesResult = ImmutableOpenMap.of();
|
||||
|
|
|
@ -87,7 +87,7 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomO
|
|||
}
|
||||
|
||||
@Override
|
||||
protected GetFieldMappingsResponse shardOperation(final GetFieldMappingsIndexRequest request, ShardId shardId) throws ElasticsearchException {
|
||||
protected GetFieldMappingsResponse shardOperation(final GetFieldMappingsIndexRequest request, ShardId shardId) {
|
||||
assert shardId != null;
|
||||
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
Collection<String> typeIntersection;
|
||||
|
@ -173,7 +173,7 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomO
|
|||
}
|
||||
};
|
||||
|
||||
private ImmutableMap<String, FieldMappingMetaData> findFieldMappingsByType(DocumentMapper documentMapper, GetFieldMappingsIndexRequest request) throws ElasticsearchException {
|
||||
private ImmutableMap<String, FieldMappingMetaData> findFieldMappingsByType(DocumentMapper documentMapper, GetFieldMappingsIndexRequest request) {
|
||||
MapBuilder<String, FieldMappingMetaData> fieldMappings = new MapBuilder<>();
|
||||
final DocumentFieldMappers allFieldMappers = documentMapper.mappers();
|
||||
for (String field : request.fields()) {
|
||||
|
|
|
@ -60,7 +60,7 @@ public class TransportGetMappingsAction extends TransportClusterInfoAction<GetMa
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doMasterOperation(final GetMappingsRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetMappingsResponse> listener) throws ElasticsearchException {
|
||||
protected void doMasterOperation(final GetMappingsRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetMappingsResponse> listener) {
|
||||
logger.trace("serving getMapping request based on version {}", state.version());
|
||||
ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> result = state.metaData().findMappings(
|
||||
concreteIndices, request.types()
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.action.admin.indices.mapping.put;
|
|||
|
||||
import com.carrotsearch.hppc.ObjectOpenHashSet;
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
|
|
@ -65,7 +65,7 @@ public class TransportPutMappingAction extends TransportMasterNodeOperationActio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final PutMappingRequest request, final ClusterState state, final ActionListener<PutMappingResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final PutMappingRequest request, final ClusterState state, final ActionListener<PutMappingResponse> listener) {
|
||||
final String[] concreteIndices = clusterService.state().metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
PutMappingClusterStateUpdateRequest updateRequest = new PutMappingClusterStateUpdateRequest()
|
||||
.ackTimeout(request.timeout()).masterNodeTimeout(request.masterNodeTimeout())
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TransportOpenIndexAction extends TransportMasterNodeOperationAction
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final OpenIndexRequest request, final ClusterState state, final ActionListener<OpenIndexResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final OpenIndexRequest request, final ClusterState state, final ActionListener<OpenIndexResponse> listener) {
|
||||
final String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
OpenIndexClusterStateUpdateRequest updateRequest = new OpenIndexClusterStateUpdateRequest()
|
||||
.ackTimeout(request.timeout()).masterNodeTimeout(request.masterNodeTimeout())
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TransportOptimizeAction extends TransportBroadcastOperationAction<O
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardOptimizeResponse shardOperation(ShardOptimizeRequest request) throws ElasticsearchException {
|
||||
protected ShardOptimizeResponse shardOperation(ShardOptimizeRequest request) {
|
||||
IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id());
|
||||
indexShard.optimize(request.optimizeRequest());
|
||||
return new ShardOptimizeResponse(request.shardId());
|
||||
|
|
|
@ -124,7 +124,7 @@ public class TransportRecoveryAction extends TransportBroadcastOperationAction<R
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardRecoveryResponse shardOperation(ShardRecoveryRequest request) throws ElasticsearchException {
|
||||
protected ShardRecoveryResponse shardOperation(ShardRecoveryRequest request) {
|
||||
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction<Re
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardRefreshResponse shardOperation(ShardRefreshRequest request) throws ElasticsearchException {
|
||||
protected ShardRefreshResponse shardOperation(ShardRefreshRequest request) {
|
||||
IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id());
|
||||
indexShard.refresh("api");
|
||||
logger.trace("{} refresh request executed", indexShard.shardId());
|
||||
|
|
|
@ -117,7 +117,7 @@ public class TransportIndicesSegmentsAction extends TransportBroadcastOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardSegments shardOperation(IndexShardSegmentRequest request) throws ElasticsearchException {
|
||||
protected ShardSegments shardOperation(IndexShardSegmentRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
return new ShardSegments(indexShard.routingEntry(), indexShard.engine().segments(request.verbose));
|
||||
|
|
|
@ -72,7 +72,7 @@ public class TransportGetSettingsAction extends TransportMasterNodeReadOperation
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(GetSettingsRequest request, ClusterState state, ActionListener<GetSettingsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(GetSettingsRequest request, ClusterState state, ActionListener<GetSettingsResponse> listener) {
|
||||
String[] concreteIndices = state.metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
ImmutableOpenMap.Builder<String, Settings> indexToSettingsBuilder = ImmutableOpenMap.builder();
|
||||
for (String concreteIndex : concreteIndices) {
|
||||
|
|
|
@ -74,7 +74,7 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final UpdateSettingsRequest request, final ClusterState state, final ActionListener<UpdateSettingsResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final UpdateSettingsRequest request, final ClusterState state, final ActionListener<UpdateSettingsResponse> listener) {
|
||||
final String[] concreteIndices = clusterService.state().metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
UpdateSettingsClusterStateUpdateRequest clusterStateUpdateRequest = new UpdateSettingsClusterStateUpdateRequest()
|
||||
.indices(concreteIndices)
|
||||
|
|
|
@ -119,7 +119,7 @@ public class TransportIndicesStatsAction extends TransportBroadcastOperationActi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticsearchException {
|
||||
protected ShardStats shardOperation(IndexShardStatsRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
// if we don't have the routing entry yet, we need it stats wise, we treat it as if the shard is not ready yet
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TransportDeleteIndexTemplateAction extends TransportMasterNodeOpera
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final DeleteIndexTemplateRequest request, final ClusterState state, final ActionListener<DeleteIndexTemplateResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final DeleteIndexTemplateRequest request, final ClusterState state, final ActionListener<DeleteIndexTemplateResponse> listener) {
|
||||
indexTemplateService.removeTemplates(new MetaDataIndexTemplateService.RemoveRequest(request.name()).masterTimeout(request.masterNodeTimeout()), new MetaDataIndexTemplateService.RemoveListener() {
|
||||
@Override
|
||||
public void onResponse(MetaDataIndexTemplateService.RemoveResponse response) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TransportGetIndexTemplatesAction extends TransportMasterNodeReadOpe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(GetIndexTemplatesRequest request, ClusterState state, ActionListener<GetIndexTemplatesResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(GetIndexTemplatesRequest request, ClusterState state, ActionListener<GetIndexTemplatesResponse> listener) {
|
||||
List<IndexTemplateMetaData> results;
|
||||
|
||||
// If we did not ask for a specific name, then we return all templates
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.elasticsearch.action.admin.indices.template.put;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TransportPutIndexTemplateAction extends TransportMasterNodeOperatio
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final PutIndexTemplateRequest request, final ClusterState state, final ActionListener<PutIndexTemplateResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final PutIndexTemplateRequest request, final ClusterState state, final ActionListener<PutIndexTemplateResponse> listener) {
|
||||
String cause = request.cause();
|
||||
if (cause.length() == 0) {
|
||||
cause = "api";
|
||||
|
|
|
@ -156,7 +156,7 @@ public class TransportValidateQueryAction extends TransportBroadcastOperationAct
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request) throws ElasticsearchException {
|
||||
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexQueryParserService queryParserService = indexService.queryParserService();
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
|
|
|
@ -72,7 +72,7 @@ public class TransportDeleteWarmerAction extends TransportMasterNodeOperationAct
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final DeleteWarmerRequest request, final ClusterState state, final ActionListener<DeleteWarmerResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final DeleteWarmerRequest request, final ClusterState state, final ActionListener<DeleteWarmerResponse> listener) {
|
||||
final String[] concreteIndices = clusterService.state().metaData().concreteIndices(request.indicesOptions(), request.indices());
|
||||
clusterService.submitStateUpdateTask("delete_warmer [" + Arrays.toString(request.names()) + "]", new AckedClusterStateUpdateTask<DeleteWarmerResponse>(request, listener) {
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransportGetWarmersAction extends TransportClusterInfoAction<GetWar
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doMasterOperation(final GetWarmersRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetWarmersResponse> listener) throws ElasticsearchException {
|
||||
protected void doMasterOperation(final GetWarmersRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetWarmersResponse> listener) {
|
||||
ImmutableOpenMap<String, ImmutableList<IndexWarmersMetaData.Entry>> result = state.metaData().findWarmers(
|
||||
concreteIndices, request.types(), request.warmers()
|
||||
);
|
||||
|
|
|
@ -85,7 +85,7 @@ public class TransportPutWarmerAction extends TransportMasterNodeOperationAction
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final PutWarmerRequest request, final ClusterState state, final ActionListener<PutWarmerResponse> listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final PutWarmerRequest request, final ClusterState state, final ActionListener<PutWarmerResponse> listener) {
|
||||
// first execute the search request, see that its ok...
|
||||
SearchRequest searchRequest = new SearchRequest(request.searchRequest(), request);
|
||||
searchAction.execute(searchRequest, new ActionListener<SearchResponse>() {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.bulk;
|
||||
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.delete.DeleteRequest;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.bulk;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.*;
|
||||
import org.elasticsearch.action.delete.DeleteRequest;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.bulk;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionWriteResponse;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.count;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.support.QuerySourceBuilder;
|
||||
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
|
||||
|
|
|
@ -143,7 +143,7 @@ public class TransportCountAction extends TransportBroadcastOperationAction<Coun
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardCountResponse shardOperation(ShardCountRequest request) throws ElasticsearchException {
|
||||
protected ShardCountResponse shardOperation(ShardCountRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.delete;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.RoutingMissingException;
|
||||
|
|
|
@ -144,7 +144,7 @@ public class TransportExistsAction extends TransportBroadcastOperationAction<Exi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardExistsResponse shardOperation(ShardExistsRequest request) throws ElasticsearchException {
|
||||
protected ShardExistsResponse shardOperation(ShardExistsRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class TransportExplainAction extends TransportShardSingleOperationAction<
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ExplainResponse shardOperation(ExplainRequest request, ShardId shardId) throws ElasticsearchException {
|
||||
protected ExplainResponse shardOperation(ExplainRequest request, ShardId shardId) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(shardId.id());
|
||||
Term uidTerm = new Term(UidFieldMapper.NAME, Uid.createUidAsBytes(request.type(), request.id()));
|
||||
|
@ -149,7 +149,7 @@ public class TransportExplainAction extends TransportShardSingleOperationAction<
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardIterator shards(ClusterState state, InternalRequest request) throws ElasticsearchException {
|
||||
protected ShardIterator shards(ClusterState state, InternalRequest request) {
|
||||
return clusterService.operationRouting().getShards(
|
||||
clusterService.state(), request.concreteIndex(), request.request().type(), request.request().id(), request.request().routing(), request.request().preference()
|
||||
);
|
||||
|
|
|
@ -23,8 +23,6 @@ import org.apache.lucene.index.IndexReader;
|
|||
import org.apache.lucene.index.MultiFields;
|
||||
import org.apache.lucene.index.Terms;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.action.ShardOperationFailedException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
|
@ -126,7 +124,7 @@ public class TransportFieldStatsTransportAction extends TransportBroadcastOperat
|
|||
}
|
||||
|
||||
@Override
|
||||
protected FieldStatsShardResponse shardOperation(FieldStatsShardRequest request) throws ElasticsearchException {
|
||||
protected FieldStatsShardResponse shardOperation(FieldStatsShardRequest request) {
|
||||
ShardId shardId = request.shardId();
|
||||
Map<String, FieldStats> fieldStats = new HashMap<>();
|
||||
IndexService indexServices = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.get;
|
||||
|
||||
import com.google.common.collect.Iterators;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.*;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
|
|
|
@ -89,7 +89,7 @@ public class TransportGetAction extends TransportShardSingleOperationAction<GetR
|
|||
}
|
||||
|
||||
@Override
|
||||
protected GetResponse shardOperation(GetRequest request, ShardId shardId) throws ElasticsearchException {
|
||||
protected GetResponse shardOperation(GetRequest request, ShardId shardId) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(shardId.id());
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TransportShardMultiGetAction extends TransportShardSingleOperationA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected MultiGetShardResponse shardOperation(MultiGetShardRequest request, ShardId shardId) throws ElasticsearchException {
|
||||
protected MultiGetShardResponse shardOperation(MultiGetShardRequest request, ShardId shardId) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(shardId.id());
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.action.index;
|
|||
import com.google.common.base.Charsets;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.*;
|
||||
import org.elasticsearch.action.support.replication.ShardReplicationOperationRequest;
|
||||
|
@ -113,7 +112,7 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
|||
}
|
||||
}
|
||||
|
||||
public static OpType fromString(String sOpType) throws IllegalArgumentException {
|
||||
public static OpType fromString(String sOpType) {
|
||||
String lowersOpType = sOpType.toLowerCase(Locale.ROOT);
|
||||
switch(lowersOpType){
|
||||
case "create":
|
||||
|
@ -490,7 +489,7 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
|||
* Sets a string representation of the {@link #opType(org.elasticsearch.action.index.IndexRequest.OpType)}. Can
|
||||
* be either "index" or "create".
|
||||
*/
|
||||
public IndexRequest opType(String opType) throws IllegalArgumentException {
|
||||
public IndexRequest opType(String opType) {
|
||||
return opType(OpType.fromString(opType));
|
||||
}
|
||||
|
||||
|
@ -559,7 +558,7 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
|||
return this.autoGeneratedId;
|
||||
}
|
||||
|
||||
public void process(MetaData metaData, @Nullable MappingMetaData mappingMd, boolean allowIdGeneration, String concreteIndex) throws ElasticsearchException {
|
||||
public void process(MetaData metaData, @Nullable MappingMetaData mappingMd, boolean allowIdGeneration, String concreteIndex) {
|
||||
// resolve the routing if needed
|
||||
routing(metaData.resolveIndexRouting(routing, index));
|
||||
// resolve timestamp if provided externally
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.action.mlt;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.*;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.search.SearchType;
|
||||
|
@ -475,7 +474,7 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> impl
|
|||
/**
|
||||
* The search type of the mlt search query.
|
||||
*/
|
||||
public MoreLikeThisRequest searchType(String searchType) throws IllegalArgumentException {
|
||||
public MoreLikeThisRequest searchType(String searchType) {
|
||||
return searchType(SearchType.fromString(searchType));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.mlt;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
|
@ -213,7 +212,7 @@ public class MoreLikeThisRequestBuilder extends ActionRequestBuilder<MoreLikeThi
|
|||
/**
|
||||
* The search type of the mlt search query.
|
||||
*/
|
||||
public MoreLikeThisRequestBuilder setSearchType(String searchType) throws IllegalArgumentException {
|
||||
public MoreLikeThisRequestBuilder setSearchType(String searchType) {
|
||||
request.searchType(searchType);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.apache.lucene.index.IndexOptions;
|
|||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.get.GetRequest;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.elasticsearch.action.percolate;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
|
|
|
@ -173,7 +173,7 @@ public class TransportPercolateAction extends TransportBroadcastOperationAction<
|
|||
}
|
||||
|
||||
@Override
|
||||
protected PercolateShardResponse shardOperation(PercolateShardRequest request) throws ElasticsearchException {
|
||||
protected PercolateShardResponse shardOperation(PercolateShardRequest request) {
|
||||
try {
|
||||
return percolatorService.percolate(request);
|
||||
} catch (Throwable e) {
|
||||
|
|
|
@ -78,14 +78,14 @@ public class TransportShardMultiPercolateAction extends TransportShardSingleOper
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardIterator shards(ClusterState state, InternalRequest request) throws ElasticsearchException {
|
||||
protected ShardIterator shards(ClusterState state, InternalRequest request) {
|
||||
return clusterService.operationRouting().getShards(
|
||||
state, request.concreteIndex(), request.request().shardId(), request.request().preference
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response shardOperation(Request request, ShardId shardId) throws ElasticsearchException {
|
||||
protected Response shardOperation(Request request, ShardId shardId) {
|
||||
// TODO: Look into combining the shard req's docs into one in memory index.
|
||||
Response response = new Response();
|
||||
response.items = new ArrayList<>(request.items.size());
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.search;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.lang.IllegalArgumentException;
|
||||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.search;
|
||||
|
||||
import org.elasticsearch.ElasticsearchGenerationException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
|
@ -241,7 +240,7 @@ public class SearchRequest extends ActionRequest<SearchRequest> implements Indic
|
|||
* one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch",
|
||||
* "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch".
|
||||
*/
|
||||
public SearchRequest searchType(String searchType) throws IllegalArgumentException {
|
||||
public SearchRequest searchType(String searchType) {
|
||||
return searchType(SearchType.fromString(searchType));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
|
@ -86,7 +85,7 @@ public class SearchRequestBuilder extends ActionRequestBuilder<SearchRequest, Se
|
|||
* one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch",
|
||||
* "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch".
|
||||
*/
|
||||
public SearchRequestBuilder setSearchType(String searchType) throws IllegalArgumentException {
|
||||
public SearchRequestBuilder setSearchType(String searchType) {
|
||||
request.searchType(searchType);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
|
||||
/**
|
||||
|
@ -109,7 +108,7 @@ public enum SearchType {
|
|||
* one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch",
|
||||
* "query_then_fetch"/"queryThenFetch", "query_and_fetch"/"queryAndFetch", and "scan".
|
||||
*/
|
||||
public static SearchType fromString(String searchType) throws IllegalArgumentException {
|
||||
public static SearchType fromString(String searchType) {
|
||||
if (searchType == null) {
|
||||
return SearchType.DEFAULT;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.search.type.*;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.search.type.ParsedScrollId;
|
||||
import org.elasticsearch.action.search.type.TransportSearchScrollQueryAndFetchAction;
|
||||
|
|
|
@ -23,8 +23,6 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.Maps;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util.CharsRefBuilder;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.search.SearchScrollRequest;
|
||||
import org.elasticsearch.action.search.SearchType;
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.carrotsearch.hppc.IntArrayList;
|
|||
|
||||
import org.apache.lucene.search.ScoreDoc;
|
||||
import org.apache.lucene.search.TopDocs;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.NoShardAvailableActionException;
|
||||
import org.elasticsearch.action.search.ReduceSearchPhaseException;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.suggest;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.action.ShardOperationFailedException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
|
||||
|
@ -128,7 +127,7 @@ public class TransportSuggestAction extends TransportBroadcastOperationAction<Su
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ShardSuggestResponse shardOperation(ShardSuggestRequest request) throws ElasticsearchException {
|
||||
protected ShardSuggestResponse shardOperation(ShardSuggestRequest request) {
|
||||
IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex());
|
||||
IndexShard indexShard = indexService.shardSafe(request.shardId().id());
|
||||
final Engine.Searcher searcher = indexShard.acquireSearcher("suggest");
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.action.support;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import java.lang.IllegalStateException;
|
||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
||||
import org.elasticsearch.action.ActionFuture;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
|
@ -40,7 +39,7 @@ public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements
|
|||
private Throwable rootFailure;
|
||||
|
||||
@Override
|
||||
public T actionGet() throws ElasticsearchException {
|
||||
public T actionGet() {
|
||||
try {
|
||||
return get();
|
||||
} catch (InterruptedException e) {
|
||||
|
@ -51,22 +50,22 @@ public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public T actionGet(String timeout) throws ElasticsearchException {
|
||||
public T actionGet(String timeout) {
|
||||
return actionGet(TimeValue.parseTimeValue(timeout, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public T actionGet(long timeoutMillis) throws ElasticsearchException {
|
||||
public T actionGet(long timeoutMillis) {
|
||||
return actionGet(timeoutMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T actionGet(TimeValue timeout) throws ElasticsearchException {
|
||||
public T actionGet(TimeValue timeout) {
|
||||
return actionGet(timeout.millis(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T actionGet(long timeout, TimeUnit unit) throws ElasticsearchException {
|
||||
public T actionGet(long timeout, TimeUnit unit) {
|
||||
try {
|
||||
return get(timeout, unit);
|
||||
} catch (TimeoutException e) {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.support;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.node.settings.NodeSettingsService;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue