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

Remove ElasticsearchIAE and ElasticsearchISE #10862

Merged
merged 2 commits into from Apr 29, 2015
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions src/main/java/org/apache/lucene/analysis/PrefixAnalyzer.java
Expand Up @@ -21,7 +21,6 @@

import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.elasticsearch.ElasticsearchIllegalArgumentException;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -97,7 +96,7 @@ public PrefixTokenFilter(TokenStream input, char separator, Iterable<? extends C
this.currentPrefix = null;
this.separator = separator;
if (prefixes == null || !prefixes.iterator().hasNext()) {
throw new ElasticsearchIllegalArgumentException("one or more prefixes needed");
throw new IllegalArgumentException("one or more prefixes needed");
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/org/apache/lucene/store/StoreRateLimiting.java
Expand Up @@ -19,7 +19,6 @@
package org.apache.lucene.store;

import org.apache.lucene.store.RateLimiter.SimpleRateLimiter;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.unit.ByteSizeValue;

Expand All @@ -42,15 +41,15 @@ public static enum Type {
MERGE,
ALL;

public static Type fromString(String type) throws ElasticsearchIllegalArgumentException {
public static Type fromString(String type) {
if ("none".equalsIgnoreCase(type)) {
return NONE;
} else if ("merge".equalsIgnoreCase(type)) {
return MERGE;
} else if ("all".equalsIgnoreCase(type)) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("rate limiting type [" + type + "] not valid, can be one of [all|merge|none]");
throw new IllegalArgumentException("rate limiting type [" + type + "] not valid, can be one of [all|merge|none]");
}
}

Expand Down Expand Up @@ -88,7 +87,7 @@ public void setType(Type type) {
this.type = type;
}

public void setType(String type) throws ElasticsearchIllegalArgumentException {
public void setType(String type) {
this.type = Type.fromString(type);
}
}

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/org/elasticsearch/Version.java
Expand Up @@ -459,12 +459,12 @@ public static Version fromId(int id) {
/**
* Return the {@link Version} of Elasticsearch that has been used to create an index given its settings.
*
* @throws ElasticsearchIllegalStateException if the given index settings doesn't contain a value for the key {@value IndexMetaData#SETTING_VERSION_CREATED}
* @throws IllegalStateException if the given index settings doesn't contain a value for the key {@value IndexMetaData#SETTING_VERSION_CREATED}
*/
public static Version indexCreated(Settings indexSettings) {
final Version indexVersion = indexSettings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null);
if (indexVersion == null) {
throw new ElasticsearchIllegalStateException("[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + indexSettings.get(IndexMetaData.SETTING_UUID) + "]");
throw new IllegalStateException("[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + indexSettings.get(IndexMetaData.SETTING_UUID) + "]");
}
return indexVersion;
}
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/org/elasticsearch/action/ActionFuture.java
Expand Up @@ -35,29 +35,29 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get()}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* 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
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* 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
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand All @@ -66,29 +66,29 @@ 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
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* 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
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* 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.
Expand Down
Expand Up @@ -69,21 +69,21 @@ public ListenableActionFuture<Response> execute() {
/**
* 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);
}

Expand Down
Expand Up @@ -19,20 +19,21 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.ElasticsearchException;


import java.util.ArrayList;
import java.util.List;

/**
*
*/
public class ActionRequestValidationException extends ElasticsearchIllegalArgumentException {
public class ActionRequestValidationException extends IllegalArgumentException {

private final List<String> validationErrors = new ArrayList<>();

public ActionRequestValidationException() {
super(null);
super("validation failed");
}

public void addValidationError(String error) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/elasticsearch/action/ThreadingModel.java
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;

/**
*
Expand Down Expand Up @@ -108,7 +107,7 @@ public static ThreadingModel fromId(byte id) {
} else if (id == 3) {
return OPERATION_LISTENER;
} else {
throw new ElasticsearchIllegalArgumentException("No threading model for [" + id + "]");
throw new IllegalArgumentException("No threading model for [" + id + "]");
}
}
}
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;

/**
* Write Consistency Level control how many replicas should be active for a write operation to occur (a write operation
Expand Down Expand Up @@ -53,7 +52,7 @@ public static WriteConsistencyLevel fromId(byte value) {
} else if (value == 3) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("No write consistency match [" + value + "]");
throw new IllegalArgumentException("No write consistency match [" + value + "]");
}

public static WriteConsistencyLevel fromString(String value) {
Expand All @@ -66,6 +65,6 @@ public static WriteConsistencyLevel fromString(String value) {
} else if (value.equals("all")) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("No write consistency match [" + value + "]");
throw new IllegalArgumentException("No write consistency match [" + value + "]");
}
}
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.action.admin.cluster.health;

import org.elasticsearch.ElasticsearchIllegalArgumentException;

/**
*
Expand Down Expand Up @@ -48,7 +47,7 @@ public static ClusterHealthStatus fromValue(byte value) {
case 2:
return RED;
default:
throw new ElasticsearchIllegalArgumentException("No cluster health status for value [" + value + "]");
throw new IllegalArgumentException("No cluster health status for value [" + value + "]");
}
}
}
Expand Up @@ -20,7 +20,6 @@
package org.elasticsearch.action.admin.cluster.health;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchIllegalStateException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.IndicesOptions;
Expand Down Expand Up @@ -66,7 +65,7 @@ protected ClusterHealthResponse newResponse() {
}

@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() {
Expand Down Expand Up @@ -141,7 +140,7 @@ public void onNewClusterState(ClusterState clusterState) {

@Override
public void onClusterServiceClose() {
listener.onFailure(new ElasticsearchIllegalStateException("ClusterService was close during health call"));
listener.onFailure(new IllegalStateException("ClusterService was close during health call"));
}

@Override
Expand Down
Expand Up @@ -73,7 +73,7 @@ protected NodeHotThreads newNodeResponse() {
}

@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)
Expand Down
Expand Up @@ -77,7 +77,7 @@ protected NodeInfo newNodeResponse() {
}

@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());
Expand Down
Expand Up @@ -77,7 +77,7 @@ protected NodeStats newNodeResponse() {
}

@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());
Expand Down
Expand Up @@ -64,7 +64,7 @@ protected ClusterBlockException checkBlock(DeleteRepositoryRequest request, Clus
}

@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()),
Expand Down