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

    Constructors
    Modifier
    Constructor
    Description
    protected
    ReplicationGroup(org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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
     
    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
     
    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>
     
    Future<org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask>
    promoteReplicaToPrimary(org.elasticsearch.index.shard.IndexShard replica)
    promotes the specific replica as the new primary
    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)
     
    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
    refresh(String source)
     
    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
     
    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

      public int indexDocs(int numOfDoc) throws Exception
      Throws:
      Exception
    • appendDocs

      public int appendDocs(int numOfDoc) throws Exception
      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

      public void startAll() throws IOException
      Throws:
      IOException
    • startReplicas

      public int startReplicas(int numOfReplicasToStart) throws IOException
      Throws:
      IOException
    • startPrimary

      public void startPrimary() throws IOException
      Throws:
      IOException
    • addReplica

      public org.elasticsearch.index.shard.IndexShard addReplica() throws IOException
      Throws:
      IOException
    • addReplica

      public void addReplica(org.elasticsearch.index.shard.IndexShard replica) throws IOException
      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

      public List<org.elasticsearch.index.shard.IndexShard> 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

      public boolean removeReplica(org.elasticsearch.index.shard.IndexShard replica) throws IOException
      Throws:
      IOException
    • recoverReplica

      public void recoverReplica(org.elasticsearch.index.shard.IndexShard replica) throws IOException
      Throws:
      IOException
    • recoverReplica

      public 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) throws IOException
      Throws:
      IOException
    • recoverReplica

      public 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) throws IOException
      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

      public void assertAllEqual(int expectedCount) throws IOException
      Throws:
      IOException
    • refresh

      public void refresh(String source)
    • flush

      public void flush()
    • shardRoutings

      public List<org.elasticsearch.cluster.routing.ShardRouting> shardRoutings()
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • iterator

      public Iterator<org.elasticsearch.index.shard.IndexShard> iterator()
      Specified by:
      iterator in interface Iterable<org.elasticsearch.index.shard.IndexShard>
    • getPrimary

      public org.elasticsearch.index.shard.IndexShard getPrimary()
    • reinitPrimaryShard

      public void reinitPrimaryShard() throws IOException
      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

      public org.elasticsearch.index.seqno.RetentionLease addRetentionLease(String id, long retainingSequenceNumber, String source, org.elasticsearch.action.ActionListener<org.elasticsearch.action.support.replication.ReplicationResponse> listener)
    • renewRetentionLease

      public org.elasticsearch.index.seqno.RetentionLease renewRetentionLease(String id, long retainingSequenceNumber, String source)
    • 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)