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>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexShard
addReplica()
void
addReplica(IndexShard replica)
IndexShard
addReplicaWithExistingPath(ShardPath shardPath, java.lang.String nodeId)
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
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)
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)
boolean
removeReplica(IndexShard replica)
java.util.List<ShardRouting>
shardRoutings()
void
startAll()
void
startPrimary()
int
startReplicas(int numOfReplicasToStart)
void
syncGlobalCheckpoint()
-
-
-
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
-
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:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
iterator
public java.util.Iterator<IndexShard> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<IndexShard>
-
getPrimary
public IndexShard getPrimary()
-
syncGlobalCheckpoint
public void syncGlobalCheckpoint()
-
-