Package org.apache.iotdb.db.wal.io
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 voidforce()Forces any updates to this file to be written to the storage device that contains it.voidforce(boolean metaData)Forces any updates to this file to be written to the storage device that contains it.java.io.FilegetLogFile()Gets the log filelongsize()Returns the current size of this file.voidwrite(java.nio.ByteBuffer buffer)Write given logs to a persistent medium.
-
-
-
Method Detail
-
write
void write(java.nio.ByteBuffer buffer) throws java.io.IOExceptionWrite 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 callforce()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.IOExceptionForces 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.IOExceptionForces 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
-
-