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
ModifierConstructorDescriptionprotected
ReplicationGroup
(org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata) -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.index.shard.IndexShard
void
addReplica
(org.elasticsearch.index.shard.IndexShard replica) org.elasticsearch.index.shard.IndexShard
addReplicaWithExistingPath
(org.elasticsearch.index.shard.ShardPath shardPath, String nodeId) org.elasticsearch.index.seqno.RetentionLease
addRetentionLease
(String id, long retainingSequenceNumber, String source, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) int
appendDocs
(int numOfDoc) void
assertAllEqual
(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) void
close()
org.elasticsearch.action.bulk.BulkItemResponse
delete
(org.elasticsearch.action.delete.DeleteRequest deleteRequest) void
executeRetentionLeasesSyncRequestOnReplica
(org.elasticsearch.index.seqno.RetentionLeaseSyncAction.Request request, org.elasticsearch.index.shard.IndexShard replica) void
flush()
protected org.elasticsearch.index.engine.EngineFactory
getEngineFactory
(org.elasticsearch.cluster.routing.ShardRouting routing) org.elasticsearch.index.shard.IndexShard
org.elasticsearch.cluster.node.DiscoveryNode
List<org.elasticsearch.index.shard.IndexShard>
org.elasticsearch.action.bulk.BulkItemResponse
index
(org.elasticsearch.action.index.IndexRequest indexRequest) int
indexDocs
(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 primaryvoid
promoteReplicaToPrimary
(org.elasticsearch.index.shard.IndexShard replica, BiConsumer<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.action.ActionListener<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncerArg) protected void
recoverPrimary
(org.elasticsearch.index.shard.IndexShard primaryShard) void
recoverReplica
(org.elasticsearch.index.shard.IndexShard replica) void
recoverReplica
(org.elasticsearch.index.shard.IndexShard replica, BiFunction<org.elasticsearch.index.shard.IndexShard, org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier) void
recoverReplica
(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) void
void
boolean
removeReplica
(org.elasticsearch.index.shard.IndexShard replica) void
removeRetentionLease
(String id, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener) org.elasticsearch.index.seqno.RetentionLease
renewRetentionLease
(String id, long retainingSequenceNumber, String source) List<org.elasticsearch.cluster.routing.ShardRouting>
void
startAll()
void
int
startReplicas
(int numOfReplicasToStart) void
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) 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
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:
close
in 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)
-