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 protected
ReplicationGroup(IndexMetaData indexMetaData)
-
Method Summary
Modifier and Type Method Description IndexShard
addReplica()
void
addReplica(IndexShard replica)
IndexShard
addReplicaWithExistingPath(ShardPath shardPath, java.lang.String nodeId)
RetentionLease
addRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source, ActionListener<ReplicationResponse> listener)
int
appendDocs(int numOfDoc)
void
assertAllEqual(int expectedCount)
java.util.concurrent.Future<java.lang.Void>
asyncRecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier)
void
close()
BulkItemResponse
delete(DeleteRequest deleteRequest)
void
executeRetentionLeasesSyncRequestOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica)
void
flush()
protected EngineFactory
getEngineFactory(ShardRouting routing)
IndexShard
getPrimary()
DiscoveryNode
getPrimaryNode()
java.util.List<IndexShard>
getReplicas()
BulkItemResponse
index(IndexRequest indexRequest)
int
indexDocs(int numOfDoc)
java.util.Iterator<IndexShard>
iterator()
java.util.concurrent.Future<PrimaryReplicaSyncer.ResyncTask>
promoteReplicaToPrimary(IndexShard replica)
promotes the specific replica as the new primaryvoid
promoteReplicaToPrimary(IndexShard replica, java.util.function.BiConsumer<IndexShard,ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer)
protected void
recoverPrimary(IndexShard primary)
void
recoverReplica(IndexShard replica)
void
recoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier)
void
recoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier, boolean markAsRecovering)
void
refresh(java.lang.String source)
void
reinitPrimaryShard()
boolean
removeReplica(IndexShard replica)
void
removeRetentionLease(java.lang.String id, ActionListener<ReplicationResponse> listener)
RetentionLease
renewRetentionLease(java.lang.String id, long retainingSequenceNumber, java.lang.String source)
java.util.List<ShardRouting>
shardRoutings()
void
startAll()
void
startPrimary()
int
startReplicas(int numOfReplicasToStart)
void
syncGlobalCheckpoint()
protected void
syncRetentionLeases(ShardId shardId, RetentionLeases leases, ActionListener<ReplicationResponse> listener)
-
Constructor Details
-
ReplicationGroup
- Throws:
java.io.IOException
-
-
Method Details
-
getEngineFactory
-
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
- Throws:
java.lang.Exception
-
delete
- 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
- Throws:
java.io.IOException
-
addReplica
- Throws:
java.io.IOException
-
recoverPrimary
-
addReplicaWithExistingPath
public IndexShard addReplicaWithExistingPath(ShardPath shardPath, java.lang.String nodeId) throws java.io.IOException- Throws:
java.io.IOException
-
getReplicas
-
promoteReplicaToPrimary
public java.util.concurrent.Future<PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(IndexShard replica) throws java.io.IOExceptionpromotes 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
- Throws:
java.io.IOException
-
recoverReplica
- 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
-
asyncRecoverReplica
public java.util.concurrent.Future<java.lang.Void> asyncRecoverReplica(IndexShard replica, java.util.function.BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier) -
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
-
close
public void close() throws java.lang.Exception- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
iterator
- Specified by:
iterator
in interfacejava.lang.Iterable<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)
-