Class ESIndexLevelReplicationTestCase.ReplicationGroup
java.lang.Object
org.elasticsearch.index.replication.ESIndexLevelReplicationTestCase.ReplicationGroup
- All Implemented Interfaces:
AutoCloseable
,Iterable<IndexShard>
- Enclosing class:
- ESIndexLevelReplicationTestCase
protected class ESIndexLevelReplicationTestCase.ReplicationGroup
extends Object
implements AutoCloseable, Iterable<IndexShard>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addReplica
(IndexShard replica) addReplicaWithExistingPath
(ShardPath shardPath, String nodeId) addRetentionLease
(String id, long retainingSequenceNumber, String source, ActionListener<ReplicationResponse> listener) int
appendDocs
(int numOfDoc) void
assertAllEqual
(int expectedCount) asyncRecoverReplica
(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, RecoveryTarget> targetSupplier) void
close()
delete
(DeleteRequest deleteRequest) void
executeRetentionLeasesSyncRequestOnReplica
(RetentionLeaseSyncAction.Request request, IndexShard replica) void
flush()
protected EngineFactory
getEngineFactory
(ShardRouting routing) index
(IndexRequest indexRequest) int
indexDocs
(int numOfDoc) iterator()
promoteReplicaToPrimary
(IndexShard replica) promotes the specific replica as the new primaryvoid
promoteReplicaToPrimary
(IndexShard replica, BiConsumer<IndexShard, ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncerArg) protected void
recoverPrimary
(IndexShard primaryShard) void
recoverReplica
(IndexShard replica) void
recoverReplica
(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, RecoveryTarget> targetSupplier) void
recoverReplica
(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, RecoveryTarget> targetSupplier, boolean markAsRecovering) void
void
boolean
removeReplica
(IndexShard replica) void
removeRetentionLease
(String id, ActionListener<ReplicationResponse> listener) renewRetentionLease
(String id, long retainingSequenceNumber, String source) void
startAll()
void
int
startReplicas
(int numOfReplicasToStart) void
protected void
syncRetentionLeases
(ShardId id, RetentionLeases leases, ActionListener<ReplicationResponse> listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ReplicationGroup
- Throws:
IOException
-
-
Method Details
-
getEngineFactory
-
indexDocs
- Throws:
Exception
-
appendDocs
- Throws:
Exception
-
index
- Throws:
Exception
-
delete
- Throws:
Exception
-
startAll
- Throws:
IOException
-
startReplicas
- Throws:
IOException
-
startPrimary
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
recoverPrimary
-
addReplicaWithExistingPath
- Throws:
IOException
-
getReplicas
-
promoteReplicaToPrimary
public Future<PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(IndexShard replica) throws IOException promotes the specific replica as the new primary- Throws:
IOException
-
promoteReplicaToPrimary
public void promoteReplicaToPrimary(IndexShard replica, BiConsumer<IndexShard, ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncerArg) throws IOException- Throws:
IOException
-
removeReplica
- Throws:
IOException
-
recoverReplica
- Throws:
IOException
-
recoverReplica
public void recoverReplica(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, throws IOExceptionRecoveryTarget> targetSupplier) - Throws:
IOException
-
recoverReplica
public void recoverReplica(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, throws IOExceptionRecoveryTarget> targetSupplier, boolean markAsRecovering) - Throws:
IOException
-
getPrimaryNode
-
asyncRecoverReplica
public Future<Void> asyncRecoverReplica(IndexShard replica, BiFunction<IndexShard, DiscoveryNode, RecoveryTarget> targetSupplier) -
assertAllEqual
- Throws:
IOException
-
refresh
-
flush
public void flush() -
shardRoutings
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
iterator
- Specified by:
iterator
in interfaceIterable<IndexShard>
-
getPrimary
-
reinitPrimaryShard
- Throws:
IOException
-
syncGlobalCheckpoint
public void syncGlobalCheckpoint() -
syncRetentionLeases
protected void syncRetentionLeases(ShardId id, RetentionLeases leases, ActionListener<ReplicationResponse> listener) -
addRetentionLease
public RetentionLease addRetentionLease(String id, long retainingSequenceNumber, String source, ActionListener<ReplicationResponse> listener) -
renewRetentionLease
-
removeRetentionLease
-
executeRetentionLeasesSyncRequestOnReplica
public void executeRetentionLeasesSyncRequestOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica)
-