Interface ILogWriter

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    CheckpointWriter, LogWriter, WALWriter

    public interface ILogWriter
    extends java.io.Closeable
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void force()
      Forces any updates to this file to be written to the storage device that contains it.
      void force​(boolean metaData)
      Forces any updates to this file to be written to the storage device that contains it.
      java.io.File getLogFile()
      Gets the log file
      long size()
      Returns the current size of this file.
      void write​(java.nio.ByteBuffer buffer)
      Write given logs to a persistent medium.
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • write

        void write​(java.nio.ByteBuffer buffer)
            throws java.io.IOException
        Write given logs to a persistent medium. NOTICE: the logs may be cached in the storage device, if the storage device you are using do not guarantee strong persistence, and you want the logs to be persisted immediately, please call force() after calling this method. Notice: do not flip the buffer before calling this method
        Parameters:
        buffer - content that have been converted to bytes
        Throws:
        java.io.IOException - if an I/O error occurs
      • force

        void force()
            throws java.io.IOException
        Forces any updates to this file to be written to the storage device that contains it.
        Throws:
        java.io.IOException - if an I/O error occurs
      • force

        void force​(boolean metaData)
            throws java.io.IOException
        Forces any updates to this file to be written to the storage device that contains it.
        Parameters:
        metaData - If true then this method is required to force changes to both the file's content and metadata to be written to storage; otherwise, it needs only force content changes to be written
        Throws:
        java.io.IOException - if an I/O error occurs
      • size

        long size()
        Returns the current size of this file.
        Returns:
        size
      • getLogFile

        java.io.File getLogFile()
        Gets the log file
        Returns:
        log file