Class BaseTranslogReader

org.elasticsearch.index.translog.BaseTranslogReader
All Implemented Interfaces:
<BaseTranslogReader>
Direct Known Subclasses:
TranslogReader, TranslogWriter

public abstract class BaseTranslogReader extends implements <BaseTranslogReader>
A base class for all classes that allows reading ops from translog files
  • Field Details

    • generation

      protected final long generation
    • channel

      protected final  channel
    • path

      protected final  path
  • Constructor Details

    • BaseTranslogReader

      public BaseTranslogReader(long generation,  channel,  path, org.elasticsearch.index.translog.TranslogHeader header)
  • Method Details

    • getGeneration

      public long getGeneration()
    • sizeInBytes

      public abstract long sizeInBytes()
    • totalOperations

      public abstract int totalOperations()
    • getFirstOperationOffset

      public final long getFirstOperationOffset()
    • getPrimaryTerm

      public final long getPrimaryTerm()
      Returns the primary term associated with this translog reader.
    • readSize

      protected final int readSize( reusableBuffer, long position) throws
      read the size of the op (i.e., number of bytes, including the op size) written at the given position
      Throws:
    • newSnapshot

      public org.elasticsearch.index.translog.TranslogSnapshot newSnapshot()
    • checksummedStream

      protected final  reusableBuffer, long position, int opSize, BufferedChecksumStreamInput reuse) throws
      reads an operation at the given position and returns it. The buffer length is equal to the number of bytes reads.
      Throws:
    • read

      protected Translog.Operation read(BufferedChecksumStreamInput inStream) throws
      Throws:
    • readBytes

      protected abstract void readBytes( buffer, long position) throws
      reads bytes at position into the given buffer, filling it.
      Throws:
    • toString

      public  toString()
      Overrides:
       in class 
    • compareTo

      public int compareTo(BaseTranslogReader o)
      Specified by:
       in interface <BaseTranslogReader>
    • path

      public  path()
    • getLastModifiedTime

      public long getLastModifiedTime() throws
      Throws: