remove declaring unchecked exception due to engine write operations

This commit is contained in:
Areek Zillur 2016-10-15 13:31:15 -04:00
parent 1bdeada8aa
commit 26f5118706
4 changed files with 8 additions and 8 deletions

View File

@ -27,7 +27,6 @@ import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.index.TransportIndexAction;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.replication.TransportWriteAction;
import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo;
@ -60,6 +59,7 @@ import java.util.Map;
import static org.elasticsearch.action.delete.TransportDeleteAction.executeDeleteRequestOnPrimary;
import static org.elasticsearch.action.delete.TransportDeleteAction.executeDeleteRequestOnReplica;
import static org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary;
import static org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnReplica;
import static org.elasticsearch.action.support.replication.ReplicationOperation.ignoreReplicaException;
import static org.elasticsearch.action.support.replication.ReplicationOperation.isConflictException;
@ -288,7 +288,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
switch (docWriteRequest.opType()) {
case CREATE:
case INDEX:
replicaResult = TransportIndexAction.executeIndexRequestOnReplica(((IndexRequest) docWriteRequest), replica);
replicaResult = executeIndexRequestOnReplica(((IndexRequest) docWriteRequest), replica);
break;
case DELETE:
replicaResult = executeDeleteRequestOnReplica(((DeleteRequest) docWriteRequest), replica);

View File

@ -278,9 +278,9 @@ public abstract class Engine implements Closeable {
}
}
public abstract void index(Index operation) throws OperationFailedEngineException;
public abstract void index(Index operation);
public abstract void delete(Delete delete) throws OperationFailedEngineException;
public abstract void delete(Delete delete);
/**
* Attempts to do a special commit where the given syncID is put into the commit data. The attempt

View File

@ -397,7 +397,7 @@ public class InternalEngine extends Engine {
}
@Override
public void index(Index index) throws OperationFailedEngineException {
public void index(Index index) {
try (ReleasableLock lock = readLock.acquire()) {
ensureOpen();
if (index.origin().isRecovery()) {
@ -563,7 +563,7 @@ public class InternalEngine extends Engine {
}
@Override
public void delete(Delete delete) throws OperationFailedEngineException {
public void delete(Delete delete) {
try (ReleasableLock lock = readLock.acquire()) {
ensureOpen();
// NOTE: we don't throttle this when merges fall behind because delete-by-id does not create new segments:

View File

@ -106,12 +106,12 @@ public class ShadowEngine extends Engine {
@Override
public void index(Index index) throws OperationFailedEngineException {
public void index(Index index) {
throw new UnsupportedOperationException(shardId + " index operation not allowed on shadow engine");
}
@Override
public void delete(Delete delete) throws OperationFailedEngineException {
public void delete(Delete delete) {
throw new UnsupportedOperationException(shardId + " delete operation not allowed on shadow engine");
}