Class TranslogReader

org.elasticsearch.index.translog.BaseTranslogReader
org.elasticsearch.index.translog.TranslogReader
All Implemented Interfaces:
, , <BaseTranslogReader>

public class TranslogReader extends BaseTranslogReader implements
an immutable translog filereader
  • Field Details

    • length

      protected final long length
    • closed

      protected final  closed
  • Method Details

    • open

      public static  channel,  path, org.elasticsearch.index.translog.Checkpoint checkpoint,  translogUUID) throws
      Given a file channel, opens a TranslogReader, taking care of checking and validating the file header.
      Parameters:
      channel - the translog file channel
      path - the path to the translog
      checkpoint - the translog checkpoint
      translogUUID - the tranlog UUID
      Returns:
      a new TranslogReader
      Throws:
      - if any of the file operations resulted in an I/O exception
    • sizeInBytes

      public long sizeInBytes()
      Specified by:
      sizeInBytes in class BaseTranslogReader
    • totalOperations

      public int totalOperations()
      Specified by:
      totalOperations in class BaseTranslogReader
    • readBytes

      protected void readBytes( buffer, long position) throws
      reads an operation at the given position into the given buffer.
      Specified by:
      readBytes in class BaseTranslogReader
      Throws:
    • close

      public final void close() throws
      Specified by:
       in interface 
      Specified by:
       in interface 
      Throws:
    • isClosed

      protected final boolean isClosed()
    • ensureOpen

      protected void ensureOpen()