Class WALWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ILogWriter

    public class WALWriter
    extends LogWriter
    WALWriter writes the binary WALEntry into .wal file.
    • Field Detail

      • MAGIC_STRING_BYTES

        public static final int MAGIC_STRING_BYTES
      • metaData

        protected final WALMetaData metaData
        wal files' metadata
    • Constructor Detail

      • WALWriter

        public WALWriter​(java.io.File logFile)
                  throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • write

        public void write​(java.nio.ByteBuffer buffer,
                          WALMetaData metaData)
                   throws java.io.IOException
        Writes buffer and update its' metadata
        Throws:
        java.io.IOException
      • updateMetaData

        public void updateMetaData​(WALMetaData metaData)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class LogWriter
        Throws:
        java.io.IOException
      • updateFileStatus

        public void updateFileStatus​(WALFileStatus walFileStatus)