remove declaring unchecked exception due to engine write operations
This commit is contained in:
parent
1bdeada8aa
commit
26f5118706
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.delete.DeleteRequest;
|
||||||
import org.elasticsearch.action.delete.DeleteResponse;
|
import org.elasticsearch.action.delete.DeleteResponse;
|
||||||
import org.elasticsearch.action.index.IndexRequest;
|
import org.elasticsearch.action.index.IndexRequest;
|
||||||
import org.elasticsearch.action.index.IndexResponse;
|
import org.elasticsearch.action.index.IndexResponse;
|
||||||
import org.elasticsearch.action.index.TransportIndexAction;
|
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.action.support.replication.TransportWriteAction;
|
import org.elasticsearch.action.support.replication.TransportWriteAction;
|
||||||
import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo;
|
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.executeDeleteRequestOnPrimary;
|
||||||
import static org.elasticsearch.action.delete.TransportDeleteAction.executeDeleteRequestOnReplica;
|
import static org.elasticsearch.action.delete.TransportDeleteAction.executeDeleteRequestOnReplica;
|
||||||
import static org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary;
|
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.ignoreReplicaException;
|
||||||
import static org.elasticsearch.action.support.replication.ReplicationOperation.isConflictException;
|
import static org.elasticsearch.action.support.replication.ReplicationOperation.isConflictException;
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
|
||||||
switch (docWriteRequest.opType()) {
|
switch (docWriteRequest.opType()) {
|
||||||
case CREATE:
|
case CREATE:
|
||||||
case INDEX:
|
case INDEX:
|
||||||
replicaResult = TransportIndexAction.executeIndexRequestOnReplica(((IndexRequest) docWriteRequest), replica);
|
replicaResult = executeIndexRequestOnReplica(((IndexRequest) docWriteRequest), replica);
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
replicaResult = executeDeleteRequestOnReplica(((DeleteRequest) docWriteRequest), replica);
|
replicaResult = executeDeleteRequestOnReplica(((DeleteRequest) docWriteRequest), replica);
|
||||||
|
|
|
@ -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
|
* Attempts to do a special commit where the given syncID is put into the commit data. The attempt
|
||||||
|
|
|
@ -397,7 +397,7 @@ public class InternalEngine extends Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void index(Index index) throws OperationFailedEngineException {
|
public void index(Index index) {
|
||||||
try (ReleasableLock lock = readLock.acquire()) {
|
try (ReleasableLock lock = readLock.acquire()) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
if (index.origin().isRecovery()) {
|
if (index.origin().isRecovery()) {
|
||||||
|
@ -563,7 +563,7 @@ public class InternalEngine extends Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Delete delete) throws OperationFailedEngineException {
|
public void delete(Delete delete) {
|
||||||
try (ReleasableLock lock = readLock.acquire()) {
|
try (ReleasableLock lock = readLock.acquire()) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
// NOTE: we don't throttle this when merges fall behind because delete-by-id does not create new segments:
|
// NOTE: we don't throttle this when merges fall behind because delete-by-id does not create new segments:
|
||||||
|
|
|
@ -106,12 +106,12 @@ public class ShadowEngine extends Engine {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void index(Index index) throws OperationFailedEngineException {
|
public void index(Index index) {
|
||||||
throw new UnsupportedOperationException(shardId + " index operation not allowed on shadow engine");
|
throw new UnsupportedOperationException(shardId + " index operation not allowed on shadow engine");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Delete delete) throws OperationFailedEngineException {
|
public void delete(Delete delete) {
|
||||||
throw new UnsupportedOperationException(shardId + " delete operation not allowed on shadow engine");
|
throw new UnsupportedOperationException(shardId + " delete operation not allowed on shadow engine");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue