Class RecoverySourceHandler


  • public class RecoverySourceHandler
    extends java.lang.Object
    RecoverySourceHandler handles the three phases of shard recovery, which is everything relating to copying the segment files as well as sending translog operations across the wire once the segments have been copied. Note: There is always one source handler per recovery that handles all the file and translog transfer. This handler is completely isolated from other recoveries while the RateLimiter passed via RecoverySettings is shared across recoveries originating from this nodes to throttle the number bytes send during file transfer. The transaction log phase bypasses the rate limiter entirely.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.logging.log4j.Logger logger  
    • Method Summary

      Modifier and Type Method Description
      void cancel​(java.lang.String reason)
      Cancels the recovery and interrupts all eligible threads.
      protected void failEngine​(java.io.IOException cause)  
      StartRecoveryRequest getRequest()  
      org.elasticsearch.indices.recovery.RecoverySourceHandler.SendFileResult phase1​(org.apache.lucene.index.IndexCommit snapshot, java.util.function.Supplier<java.lang.Integer> translogOps)
      Perform phase1 of the recovery operations.
      void recoverToTarget​(ActionListener<RecoveryResponse> listener)
      performs the recovery from the local engine to the target
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • logger

        protected final org.apache.logging.log4j.Logger logger
    • Method Detail

      • recoverToTarget

        public void recoverToTarget​(ActionListener<RecoveryResponse> listener)
        performs the recovery from the local engine to the target
      • phase1

        public org.elasticsearch.indices.recovery.RecoverySourceHandler.SendFileResult phase1​(org.apache.lucene.index.IndexCommit snapshot,
                                                                                              java.util.function.Supplier<java.lang.Integer> translogOps)
        Perform phase1 of the recovery operations. Once this IndexCommit snapshot has been performed no commit operations (files being fsync'd) are effectively allowed on this index until all recovery phases are done

        Phase1 examines the segment files on the target node and copies over the segments that are missing. Only segments that have the same size and checksum can be reused

      • cancel

        public void cancel​(java.lang.String reason)
        Cancels the recovery and interrupts all eligible threads.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • failEngine

        protected void failEngine​(java.io.IOException cause)