diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java index 8f7612be087..0925c7ff996 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java @@ -57,7 +57,7 @@ public class TransportShardReplicationPingAction extends TransportShardReplicati return new ShardReplicationPingResponse(); } - @Override protected void shardOperationOnBackup(ShardOperationRequest shardRequest) { + @Override protected void shardOperationOnReplica(ShardOperationRequest shardRequest) { } @Override protected ShardsIterator shards(ClusterState clusterState, ShardReplicationPingRequest request) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportShardGatewaySnapshotAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportShardGatewaySnapshotAction.java index 22d83fc6e99..7353ef2b824 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportShardGatewaySnapshotAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportShardGatewaySnapshotAction.java @@ -61,7 +61,7 @@ public class TransportShardGatewaySnapshotAction extends TransportShardReplicati return new ShardGatewaySnapshotResponse(); } - @Override protected void shardOperationOnBackup(ShardOperationRequest shardRequest) { + @Override protected void shardOperationOnReplica(ShardOperationRequest shardRequest) { // silently ignore, we disable it with #ignoreBackups anyhow } @@ -72,7 +72,7 @@ public class TransportShardGatewaySnapshotAction extends TransportShardReplicati /** * Snapshot should only happen on primary shards. */ - @Override protected boolean ignoreBackups() { + @Override protected boolean ignoreReplicas() { return true; } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java index ae47339987d..8f33104d5f3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java @@ -100,7 +100,7 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct return new DeleteResponse(request.index(), request.type(), request.id()); } - @Override protected void shardOperationOnBackup(ShardOperationRequest shardRequest) { + @Override protected void shardOperationOnReplica(ShardOperationRequest shardRequest) { DeleteRequest request = shardRequest.request; indexShard(shardRequest).delete(request.type(), request.id()); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java index 54527719dbd..332737ffb8a 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java @@ -66,7 +66,7 @@ public class TransportShardDeleteByQueryAction extends TransportShardReplication return new ShardDeleteByQueryResponse(); } - @Override protected void shardOperationOnBackup(ShardOperationRequest shardRequest) { + @Override protected void shardOperationOnReplica(ShardOperationRequest shardRequest) { ShardDeleteByQueryRequest request = shardRequest.request; indexShard(shardRequest).deleteByQuery(request.querySource(), request.queryParserName(), request.types()); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java index 3335903b05f..04090744007 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java @@ -137,7 +137,7 @@ public class TransportIndexAction extends TransportShardReplicationOperationActi return new IndexResponse(request.index(), request.type(), request.id()); } - @Override protected void shardOperationOnBackup(ShardOperationRequest shardRequest) { + @Override protected void shardOperationOnReplica(ShardOperationRequest shardRequest) { IndexRequest request = shardRequest.request; if (request.opType() == IndexRequest.OpType.INDEX) { indexShard(shardRequest).index(request.type(), request.id(), request.source()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java index b5a4e66525f..43b1dc75b40 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java @@ -83,7 +83,7 @@ public abstract class TransportShardReplicationOperationActionfalse meaning operations - * will be executed on the backup. + * Should the operations be performed on the replicas as well. Defaults to false meaning operations + * will be executed on the replica. */ - protected boolean ignoreBackups() { + protected boolean ignoreReplicas() { return false; } - private String transportBackupAction() { - return transportAction() + "/backup"; + private String transportReplicaAction() { + return transportAction() + "/replica"; } protected IndexShard indexShard(ShardOperationRequest shardRequest) { @@ -159,19 +159,19 @@ public abstract class TransportShardReplicationOperationAction { + private class ReplicaOperationTransportHandler extends BaseTransportRequestHandler { @Override public ShardOperationRequest newInstance() { return new ShardOperationRequest(); } @Override public void messageReceived(ShardOperationRequest request, TransportChannel channel) throws Exception { - shardOperationOnBackup(request); + shardOperationOnReplica(request); channel.sendResponse(VoidStreamable.INSTANCE); } /** - * We spawn, since we want to perform the operation on the backup on a different thread. + * We spawn, since we want to perform the operation on the replica on a different thread. */ @Override public boolean spawn() { return true; @@ -356,7 +356,7 @@ public abstract class TransportShardReplicationOperationAction @@ -533,7 +544,7 @@ public abstract class TransportShardReplicationOperationActionIndexMissingException/IndexShardMissingException: The shard has not yet started to initialize on the target node. * */ - private boolean ignoreBackupException(Throwable e) { + private boolean ignoreReplicaException(Throwable e) { if (e instanceof IllegalIndexShardStateException) { return true; }