Class OpenSearchIndexLevelReplicationTestCase.ReplicationGroup
java.lang.Object
org.opensearch.index.replication.OpenSearchIndexLevelReplicationTestCase.ReplicationGroup
- All Implemented Interfaces:
AutoCloseable,Iterable<org.opensearch.index.shard.IndexShard>
- Enclosing class:
OpenSearchIndexLevelReplicationTestCase
protected class OpenSearchIndexLevelReplicationTestCase.ReplicationGroup
extends Object
implements AutoCloseable, Iterable<org.opensearch.index.shard.IndexShard>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReplicationGroup(org.opensearch.cluster.metadata.IndexMetadata indexMetadata) protectedReplicationGroup(org.opensearch.cluster.metadata.IndexMetadata indexMetadata, Path remotePath) -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.index.shard.IndexShardorg.opensearch.index.shard.IndexShardaddReplica(Path remotePath) voidaddReplica(org.opensearch.index.shard.IndexShard replica) org.opensearch.index.shard.IndexShardaddReplicaWithExistingPath(org.opensearch.index.shard.ShardPath shardPath, String nodeId) org.opensearch.index.seqno.RetentionLeaseaddRetentionLease(String id, long retainingSequenceNumber, String source, org.opensearch.core.action.ActionListener<org.opensearch.action.support.replication.ReplicationResponse> listener) intappendDocs(int numOfDoc) voidassertAllEqual(int expectedCount) asyncRecoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier) voidclose()org.opensearch.action.bulk.BulkItemResponsedelete(org.opensearch.action.delete.DeleteRequest deleteRequest) voidexecuteRetentionLeasesSyncRequestOnReplica(org.opensearch.index.seqno.RetentionLeaseSyncAction.Request request, org.opensearch.index.shard.IndexShard replica) voidflush()org.opensearch.cluster.node.DiscoveryNodesprotected org.opensearch.index.engine.EngineConfigFactorygetEngineConfigFactory(org.opensearch.index.IndexSettings indexSettings) protected org.opensearch.index.engine.EngineFactorygetEngineFactory(org.opensearch.cluster.routing.ShardRouting routing) org.opensearch.cluster.metadata.IndexMetadataorg.opensearch.index.shard.IndexShardorg.opensearch.cluster.node.DiscoveryNodeList<org.opensearch.index.shard.IndexShard> org.opensearch.action.bulk.BulkItemResponseindex(org.opensearch.action.index.IndexRequest indexRequest) intindexDocs(int numOfDoc) Iterator<org.opensearch.index.shard.IndexShard> iterator()Future<org.opensearch.index.shard.PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(org.opensearch.index.shard.IndexShard replica) promotes the specific replica as the new primaryvoidpromoteReplicaToPrimary(org.opensearch.index.shard.IndexShard replica, BiConsumer<org.opensearch.index.shard.IndexShard, org.opensearch.core.action.ActionListener<org.opensearch.index.shard.PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer) protected voidrecoverPrimary(org.opensearch.index.shard.IndexShard primary) voidrecoverReplica(org.opensearch.index.shard.IndexShard replica) voidrecoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier) voidrecoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier, boolean markAsRecovering) voidvoidreinitPrimaryShard(Path remotePath) booleanremoveReplica(org.opensearch.index.shard.IndexShard replica) voidremoveRetentionLease(String id, org.opensearch.core.action.ActionListener<org.opensearch.action.support.replication.ReplicationResponse> listener) org.opensearch.index.seqno.RetentionLeaserenewRetentionLease(String id, long retainingSequenceNumber, String source) List<org.opensearch.cluster.routing.ShardRouting> voidstartAll()voidintstartReplicas(int numOfReplicasToStart) voidprotected voidsyncRetentionLeases(org.opensearch.core.index.shard.ShardId shardId, org.opensearch.index.seqno.RetentionLeases leases, org.opensearch.core.action.ActionListener<org.opensearch.action.support.replication.ReplicationResponse> listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ReplicationGroup
protected ReplicationGroup(org.opensearch.cluster.metadata.IndexMetadata indexMetadata) throws IOException - Throws:
IOException
-
ReplicationGroup
protected ReplicationGroup(org.opensearch.cluster.metadata.IndexMetadata indexMetadata, Path remotePath) throws IOException - Throws:
IOException
-
-
Method Details
-
getEngineFactory
protected org.opensearch.index.engine.EngineFactory getEngineFactory(org.opensearch.cluster.routing.ShardRouting routing) -
getEngineConfigFactory
protected org.opensearch.index.engine.EngineConfigFactory getEngineConfigFactory(org.opensearch.index.IndexSettings indexSettings) -
getIndexMetadata
public org.opensearch.cluster.metadata.IndexMetadata getIndexMetadata() -
indexDocs
-
appendDocs
-
index
-
delete
-
startAll
- Throws:
IOException
-
generateFakeDiscoveryNodes
public org.opensearch.cluster.node.DiscoveryNodes generateFakeDiscoveryNodes() -
startReplicas
- Throws:
IOException
-
startPrimary
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
addReplica
- Throws:
IOException
-
recoverPrimary
protected void recoverPrimary(org.opensearch.index.shard.IndexShard primary) -
addReplicaWithExistingPath
public org.opensearch.index.shard.IndexShard addReplicaWithExistingPath(org.opensearch.index.shard.ShardPath shardPath, String nodeId) throws IOException - Throws:
IOException
-
getReplicas
-
promoteReplicaToPrimary
public Future<org.opensearch.index.shard.PrimaryReplicaSyncer.ResyncTask> promoteReplicaToPrimary(org.opensearch.index.shard.IndexShard replica) throws IOException promotes the specific replica as the new primary- Throws:
IOException
-
promoteReplicaToPrimary
public void promoteReplicaToPrimary(org.opensearch.index.shard.IndexShard replica, BiConsumer<org.opensearch.index.shard.IndexShard, org.opensearch.core.action.ActionListener<org.opensearch.index.shard.PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer) throws IOException - Throws:
IOException
-
removeReplica
- Throws:
IOException
-
recoverReplica
- Throws:
IOException
-
recoverReplica
public void recoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier) throws IOException - Throws:
IOException
-
recoverReplica
public void recoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier, boolean markAsRecovering) throws IOException - Throws:
IOException
-
getPrimaryNode
public org.opensearch.cluster.node.DiscoveryNode getPrimaryNode() -
asyncRecoverReplica
public Future<Void> asyncRecoverReplica(org.opensearch.index.shard.IndexShard replica, BiFunction<org.opensearch.index.shard.IndexShard, org.opensearch.cluster.node.DiscoveryNode, org.opensearch.indices.recovery.RecoveryTarget> targetSupplier) -
assertAllEqual
- Throws:
IOException
-
refresh
-
flush
public void flush() -
shardRoutings
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
iterator
-
getPrimary
public org.opensearch.index.shard.IndexShard getPrimary() -
reinitPrimaryShard
- Throws:
IOException
-
syncGlobalCheckpoint
public void syncGlobalCheckpoint() -
syncRetentionLeases
protected void syncRetentionLeases(org.opensearch.core.index.shard.ShardId shardId, org.opensearch.index.seqno.RetentionLeases leases, org.opensearch.core.action.ActionListener<org.opensearch.action.support.replication.ReplicationResponse> listener) -
addRetentionLease
-
renewRetentionLease
-
removeRetentionLease
public void removeRetentionLease(String id, org.opensearch.core.action.ActionListener<org.opensearch.action.support.replication.ReplicationResponse> listener) -
executeRetentionLeasesSyncRequestOnReplica
public void executeRetentionLeasesSyncRequestOnReplica(org.opensearch.index.seqno.RetentionLeaseSyncAction.Request request, org.opensearch.index.shard.IndexShard replica)
-