Interface ILogWriter

  • All Known Implementing Classes:
    LogWriter

    public interface ILogWriter
    ILogWriter provides functions to insert WAL logs that have already been converted to bytes to a persistent medium.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      release resources occupied by this object, like file streams.
      void force()
      force the OS/FileSystem to flush its cache to make sure logs are persisted.
      void write​(java.nio.ByteBuffer logBuffer)
      Write given logs to a persistent medium.
    • Method Detail

      • write

        void write​(java.nio.ByteBuffer logBuffer)
            throws java.io.IOException
        Write given logs to a persistent medium. NOTICE: the logs may be cached in the OS/FileSystem, if the OS/FileSystem you are using do not guarantee strong persistency 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:
        logBuffer - WAL logs that have been converted to bytes
        Throws:
        java.io.IOException
      • force

        void force()
            throws java.io.IOException
        force the OS/FileSystem to flush its cache to make sure logs are persisted.
        Throws:
        java.io.IOException
      • close

        void close()
            throws java.io.IOException
        release resources occupied by this object, like file streams.
        Throws:
        java.io.IOException