Package org.apache.iotdb.db.wal.buffer
Class AbstractWALBuffer
- java.lang.Object
-
- org.apache.iotdb.db.wal.buffer.AbstractWALBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable,IWALBuffer
- Direct Known Subclasses:
WALBuffer
public abstract class AbstractWALBuffer extends java.lang.Object implements IWALBuffer
-
-
Field Summary
Fields Modifier and Type Field Description protected longcurrentSearchIndexcurrent search indexprotected java.util.concurrent.atomic.AtomicLongcurrentWALFileVersioncurrent wal file version idprotected WALWritercurrentWALFileWritercurrent wal file log writerprotected java.lang.StringidentifierWALNode identifier of this bufferprotected java.lang.StringlogDirectorydirectory to store .wal files
-
Constructor Summary
Constructors Constructor Description AbstractWALBuffer(java.lang.String identifier, java.lang.String logDirectory, long startFileVersion, long startSearchIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCurrentSearchIndex()Get current search indexlonggetCurrentWALFileSize()Get current wal file's sizelonggetCurrentWALFileVersion()Get current log version idprotected voidrollLogWriter(long searchIndex, WALFileStatus fileStatus)Notice: only called by syncBufferThread and old log writer will be closed by this function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.iotdb.db.wal.buffer.IWALBuffer
close, isAllWALEntriesConsumed, waitForFlush, waitForFlush, write
-
-
-
-
Field Detail
-
identifier
protected final java.lang.String identifier
WALNode identifier of this buffer
-
logDirectory
protected final java.lang.String logDirectory
directory to store .wal files
-
currentWALFileVersion
protected final java.util.concurrent.atomic.AtomicLong currentWALFileVersion
current wal file version id
-
currentSearchIndex
protected volatile long currentSearchIndex
current search index
-
currentWALFileWriter
protected volatile WALWriter currentWALFileWriter
current wal file log writer
-
-
Method Detail
-
getCurrentWALFileVersion
public long getCurrentWALFileVersion()
Description copied from interface:IWALBufferGet current log version id- Specified by:
getCurrentWALFileVersionin interfaceIWALBuffer
-
getCurrentWALFileSize
public long getCurrentWALFileSize()
Description copied from interface:IWALBufferGet current wal file's size- Specified by:
getCurrentWALFileSizein interfaceIWALBuffer
-
rollLogWriter
protected void rollLogWriter(long searchIndex, WALFileStatus fileStatus) throws java.io.IOExceptionNotice: only called by syncBufferThread and old log writer will be closed by this function.- Throws:
java.io.IOException
-
getCurrentSearchIndex
public long getCurrentSearchIndex()
Description copied from interface:IWALBufferGet current search index- Specified by:
getCurrentSearchIndexin interfaceIWALBuffer
-
-