Class ESIndexLevelReplicationTestCase.ReplicationGroup
java.lang.Object
org.elasticsearch.index.replication.ESIndexLevelReplicationTestCase.ReplicationGroup
- All Implemented Interfaces:
AutoCloseable,Iterable<org.elasticsearch.index.shard.IndexShard>
- Enclosing class:
- ESIndexLevelReplicationTestCase
protected class ESIndexLevelReplicationTestCase.ReplicationGroup
extends Object
implements AutoCloseable, Iterable<org.elasticsearch.index.shard.IndexShard>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReplicationGroup(org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata) -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.index.shard.IndexShardvoidaddReplica(org.elasticsearch.index.shard.IndexShard replica) org.elasticsearch.index.shard.IndexShardaddReplicaWithExistingPath(org.elasticsearch.index.shard.ShardPath shardPath, String nodeId) org.elasticsearch.index.seqno.RetentionLeaseaddRetentionLease(String id, long retainingSequenceNumber, String source, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) intappendDocs(int numOfDoc) voidassertAllEqual(int expectedCount) asyncRecoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier) voidclose()org.elasticsearch.action.bulk.BulkItemResponsedelete(org.elasticsearch.action.delete.DeleteRequest deleteRequest) voidexecuteRetentionLeasesSyncRequestOnReplica(org.elasticsearch.index.seqno.RetentionLeaseSyncAction.Request request, org.elasticsearch.index.shard.IndexShard replica) voidflush()protected org.elasticsearch.index.engine.EngineFactorygetEngineFactory(org.elasticsearch.cluster.routing.ShardRouting routing) org.elasticsearch.index.shard.IndexShardorg.elasticsearch.cluster.node.DiscoveryNodeList<org.elasticsearch.index.shard.IndexShard>org.elasticsearch.action.bulk.BulkItemResponseindex(org.elasticsearch.action.index.IndexRequest indexRequest) intindexDocs(int numOfDoc) Iterator<org.elasticsearch.index.shard.IndexShard>iterator()Future<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask>promoteReplicaToPrimary(org.elasticsearch.index.shard.IndexShard replica) promotes the specific replica as the new primaryvoidpromoteReplicaToPrimary(org.elasticsearch.index.shard.IndexShard replica, BiConsumer<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.action.ActionListener<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncerArg) protected voidrecoverPrimary(org.elasticsearch.index.shard.IndexShard primaryShard) voidrecoverReplica(org.elasticsearch.index.shard.IndexShard replica) voidrecoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier) voidrecoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier, boolean markAsRecovering) voidvoidbooleanremoveReplica(org.elasticsearch.index.shard.IndexShard replica) voidremoveRetentionLease(String id, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) org.elasticsearch.index.seqno.RetentionLeaserenewRetentionLease(String id, long retainingSequenceNumber, String source) List<org.elasticsearch.cluster.routing.ShardRouting>voidstartAll()voidintstartReplicas(int numOfReplicasToStart) voidprotected voidsyncRetentionLeases(org.elasticsearch.index.shard.ShardId id, org.elasticsearch.index.seqno.RetentionLeases leases, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ReplicationGroup
protected ReplicationGroup(org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata) throws IOException - Throws:
IOException
-
-
Method Details
-
getEngineFactory
protected org.elasticsearch.index.engine.EngineFactory getEngineFactory(org.elasticsearch.cluster.routing.ShardRouting routing) -
indexDocs
- Throws:
Exception
-
appendDocs
- Throws:
Exception
-
index
public org.elasticsearch.action.bulk.BulkItemResponse index(org.elasticsearch.action.index.IndexRequest indexRequest) throws Exception - Throws:
Exception
-
delete
public org.elasticsearch.action.bulk.BulkItemResponse delete(org.elasticsearch.action.delete.DeleteRequest deleteRequest) throws Exception - Throws:
Exception
-
startAll
- Throws:
IOException
-
startReplicas
- Throws:
IOException
-
startPrimary
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
recoverPrimary
protected void recoverPrimary(org.elasticsearch.index.shard.IndexShard primaryShard) -
addReplicaWithExistingPath
public org.elasticsearch.index.shard.IndexShard addReplicaWithExistingPath(org.elasticsearch.index.shard.ShardPath shardPath, String nodeId) throws IOException - Throws:
IOException
-
getReplicas
-
promoteReplicaToPrimary
public Future<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(org.elasticsearch.index.shard.IndexShard replica) throws IOException promotes the specific replica as the new primary- Throws:
IOException
-
promoteReplicaToPrimary
public void promoteReplicaToPrimary(org.elasticsearch.index.shard.IndexShard replica, BiConsumer<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.action.ActionListener<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncerArg) throws IOException- Throws:
IOException
-
removeReplica
- Throws:
IOException
-
recoverReplica
- Throws:
IOException
-
recoverReplica
public void recoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, throws IOExceptionorg.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier) - Throws:
IOException
-
recoverReplica
public void recoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, throws IOExceptionorg.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier, boolean markAsRecovering) - Throws:
IOException
-
getPrimaryNode
public org.elasticsearch.cluster.node.DiscoveryNode getPrimaryNode() -
asyncRecoverReplica
public Future<Void> asyncRecoverReplica(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier) -
assertAllEqual
- Throws:
IOException
-
refresh
-
flush
public void flush() -
shardRoutings
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
iterator
-
getPrimary
public org.elasticsearch.index.shard.IndexShard getPrimary() -
reinitPrimaryShard
- Throws:
IOException
-
syncGlobalCheckpoint
public void syncGlobalCheckpoint() -
syncRetentionLeases
protected void syncRetentionLeases(org.elasticsearch.index.shard.ShardId id, org.elasticsearch.index.seqno.RetentionLeases leases, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) -
addRetentionLease
-
renewRetentionLease
-
removeRetentionLease
public void removeRetentionLease(String id, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) -
executeRetentionLeasesSyncRequestOnReplica
public void executeRetentionLeasesSyncRequestOnReplica(org.elasticsearch.index.seqno.RetentionLeaseSyncAction.Request request, org.elasticsearch.index.shard.IndexShard replica)
-