Class ESIndexLevelReplicationTestCase.ReplicationGroup
- java.lang.Object
-
- org.elasticsearch.index.replication.ESIndexLevelReplicationTestCase.ReplicationGroup
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Iterable<IndexShard>
- Enclosing class:
- ESIndexLevelReplicationTestCase
protected class ESIndexLevelReplicationTestCase.ReplicationGroup extends java.lang.Object implements java.lang.AutoCloseable, java.lang.Iterable<IndexShard>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedReplicationGroup(IndexMetaData indexMetaData)
-
Method Summary
Modifier and Type Method Description IndexShardaddReplica()voidaddReplica(IndexShard replica)IndexShardaddReplicaWithExistingPath(ShardPath shardPath, java.lang.String nodeId)RetentionLeaseaddRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source, ActionListener<ReplicationResponse> listener)intappendDocs(int numOfDoc)voidassertAllEqual(int expectedCount)java.util.concurrent.Future<java.lang.Void>asyncRecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier)voidclose()BulkItemResponsedelete(DeleteRequest deleteRequest)voidexecuteRetentionLeasesSyncRequestOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica)voidflush()protected EngineFactorygetEngineFactory(ShardRouting routing)IndexShardgetPrimary()DiscoveryNodegetPrimaryNode()java.util.List<IndexShard>getReplicas()BulkItemResponseindex(IndexRequest indexRequest)intindexDocs(int numOfDoc)java.util.Iterator<IndexShard>iterator()java.util.concurrent.Future<PrimaryReplicaSyncer.ResyncTask>promoteReplicaToPrimary(IndexShard replica)promotes the specific replica as the new primaryvoidpromoteReplicaToPrimary(IndexShard replica, java.util.function.BiConsumer<IndexShard,ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer)protected voidrecoverPrimary(IndexShard primary)voidrecoverReplica(IndexShard replica)voidrecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier)voidrecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier, boolean markAsRecovering)voidrefresh(java.lang.String source)voidreinitPrimaryShard()booleanremoveReplica(IndexShard replica)voidremoveRetentionLease(java.lang.String id, ActionListener<ReplicationResponse> listener)RetentionLeaserenewRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source)java.util.List<ShardRouting>shardRoutings()voidstartAll()voidstartPrimary()intstartReplicas(int numOfReplicasToStart)voidsyncGlobalCheckpoint()protected voidsyncRetentionLeases(ShardId shardId, RetentionLeases leases, ActionListener<ReplicationResponse> listener)
-
-
-
Constructor Detail
-
ReplicationGroup
protected ReplicationGroup(IndexMetaData indexMetaData) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getEngineFactory
protected EngineFactory getEngineFactory(ShardRouting routing)
-
indexDocs
public int indexDocs(int numOfDoc) throws java.lang.Exception- Throws:
java.lang.Exception
-
appendDocs
public int appendDocs(int numOfDoc) throws java.lang.Exception- Throws:
java.lang.Exception
-
index
public BulkItemResponse index(IndexRequest indexRequest) throws java.lang.Exception
- Throws:
java.lang.Exception
-
delete
public BulkItemResponse delete(DeleteRequest deleteRequest) throws java.lang.Exception
- Throws:
java.lang.Exception
-
startAll
public void startAll() throws java.io.IOException- Throws:
java.io.IOException
-
startReplicas
public int startReplicas(int numOfReplicasToStart) throws java.io.IOException- Throws:
java.io.IOException
-
startPrimary
public void startPrimary() throws java.io.IOException- Throws:
java.io.IOException
-
addReplica
public IndexShard addReplica() throws java.io.IOException
- Throws:
java.io.IOException
-
addReplica
public void addReplica(IndexShard replica) throws java.io.IOException
- Throws:
java.io.IOException
-
recoverPrimary
protected void recoverPrimary(IndexShard primary)
-
addReplicaWithExistingPath
public IndexShard addReplicaWithExistingPath(ShardPath shardPath, java.lang.String nodeId) throws java.io.IOException
- Throws:
java.io.IOException
-
getReplicas
public java.util.List<IndexShard> getReplicas()
-
promoteReplicaToPrimary
public java.util.concurrent.Future<PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(IndexShard replica) throws java.io.IOException
promotes the specific replica as the new primary- Throws:
java.io.IOException
-
promoteReplicaToPrimary
public void promoteReplicaToPrimary(IndexShard replica, java.util.function.BiConsumer<IndexShard,ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer) throws java.io.IOException
- Throws:
java.io.IOException
-
removeReplica
public boolean removeReplica(IndexShard replica) throws java.io.IOException
- Throws:
java.io.IOException
-
recoverReplica
public void recoverReplica(IndexShard replica) throws java.io.IOException
- Throws:
java.io.IOException
-
recoverReplica
public void recoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier) throws java.io.IOException
- Throws:
java.io.IOException
-
recoverReplica
public void recoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier, boolean markAsRecovering) throws java.io.IOException
- Throws:
java.io.IOException
-
getPrimaryNode
public DiscoveryNode getPrimaryNode()
-
asyncRecoverReplica
public java.util.concurrent.Future<java.lang.Void> asyncRecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier) throws java.io.IOException
- Throws:
java.io.IOException
-
assertAllEqual
public void assertAllEqual(int expectedCount) throws java.io.IOException- Throws:
java.io.IOException
-
refresh
public void refresh(java.lang.String source)
-
flush
public void flush()
-
shardRoutings
public java.util.List<ShardRouting> shardRoutings()
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
iterator
public java.util.Iterator<IndexShard> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<IndexShard>
-
getPrimary
public IndexShard getPrimary()
-
reinitPrimaryShard
public void reinitPrimaryShard() throws java.io.IOException- Throws:
java.io.IOException
-
syncGlobalCheckpoint
public void syncGlobalCheckpoint()
-
syncRetentionLeases
protected void syncRetentionLeases(ShardId shardId, RetentionLeases leases, ActionListener<ReplicationResponse> listener)
-
addRetentionLease
public RetentionLease addRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source, ActionListener<ReplicationResponse> listener)
-
renewRetentionLease
public RetentionLease renewRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source)
-
removeRetentionLease
public void removeRetentionLease(java.lang.String id, ActionListener<ReplicationResponse> listener)
-
executeRetentionLeasesSyncRequestOnReplica
public void executeRetentionLeasesSyncRequestOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica)
-
-