Class RotatingLogIndex

java.lang.Object
org.teamapps.universaldb.index.log.RotatingLogIndex
All Implemented Interfaces:
LogIndex

public class RotatingLogIndex
extends java.lang.Object
implements LogIndex
  • Constructor Details

    • RotatingLogIndex

      public RotatingLogIndex​(java.io.File basePath, java.lang.String name)
    • RotatingLogIndex

      public RotatingLogIndex​(java.io.File basePath, java.lang.String name, int maxLogFileSize, int scanUpToFileIndex)
  • Method Details

    • writeLog

      public long writeLog​(byte[] bytes, boolean committed)
      Specified by:
      writeLog in interface LogIndex
    • readLog

      public byte[] readLog​(long storePosition)
      Specified by:
      readLog in interface LogIndex
    • readLogs

      public LogIterator readLogs()
      Specified by:
      readLogs in interface LogIndex
    • readLogs

      public LogIterator readLogs​(long pos)
      Specified by:
      readLogs in interface LogIndex
    • readLogs

      public void readLogs​(java.util.List<IndexMessage> messages)
      Specified by:
      readLogs in interface LogIndex
    • readLogPositions

      public long[] readLogPositions()
      Specified by:
      readLogPositions in interface LogIndex
    • getPosition

      public long getPosition()
      Specified by:
      getPosition in interface LogIndex
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface LogIndex
    • getStoreSize

      public long getStoreSize()
      Specified by:
      getStoreSize in interface LogIndex
    • flush

      public void flush()
      Specified by:
      flush in interface LogIndex
    • close

      public void close()
      Specified by:
      close in interface LogIndex
    • drop

      public void drop()
      Specified by:
      drop in interface LogIndex
    • calculatePosition

      public static long calculatePosition​(int fileIndex, int filePos)
    • getFileIndex

      public static int getFileIndex​(long storePosition)
    • getFilePos

      public static int getFilePos​(long storePosition)