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 Summary

    Constructors
    Constructor Description
    RotatingLogIndex​(java.io.File basePath, java.lang.String name)  
    RotatingLogIndex​(java.io.File basePath, java.lang.String name, int maxLogFileSize, int scanUpToFileIndex)  
  • Method Summary

    Modifier and Type Method Description
    static long calculatePosition​(int fileIndex, int filePos)  
    void close()  
    void drop()  
    void flush()  
    static int getFileIndex​(long storePosition)  
    static int getFilePos​(long storePosition)  
    long getPosition()  
    boolean isEmpty()  
    byte[] readLog​(long storePosition)  
    LogIterator readLogs()  
    LogIterator readLogs​(long pos)  
    long writeLog​(byte[] bytes, boolean committed)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.teamapps.universaldb.index.log.LogIndex

    readAllLogs, writeLog
  • 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
    • getPosition

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

      public boolean isEmpty()
      Specified by:
      isEmpty 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)