Package org.apache.hadoop.hbase.wal
Interface WALProvider.WriterBase
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Subinterfaces:
AsyncFSWALProvider.AsyncWriter
,FSHLogProvider.Writer
,WALProvider.AsyncWriter
,WALProvider.Writer
- All Known Implementing Classes:
AsyncProtobufLogWriter
,CombinedAsyncWriter
,CombinedWriter
,CombinedWriterBase
,ProtobufLogWriter
- Enclosing interface:
- WALProvider
-
Method Summary
Modifier and TypeMethodDescriptionlong
long
NOTE: We add this method forWALFileLengthProvider
used for replication, considering the case if we useAsyncFSWAL
,we write to 3 DNs concurrently, according to the visibility guarantee of HDFS, the data will be available immediately when arriving at DN since all the DNs will be considered as the last one in pipeline.
-
Method Details
-
getLength
long getLength() -
getSyncedLength
long getSyncedLength()NOTE: We add this method forWALFileLengthProvider
used for replication, considering the case if we useAsyncFSWAL
,we write to 3 DNs concurrently, according to the visibility guarantee of HDFS, the data will be available immediately when arriving at DN since all the DNs will be considered as the last one in pipeline. This means replication may read uncommitted data and replicate it to the remote cluster and cause data inconsistency. The methodgetLength()
may return length which just in hdfs client buffer and not successfully synced to HDFS, so we use this method to return the length successfully synced to HDFS and replication thread could only read writing WAL file limited by this length. see also HBASE-14004 and this document for more details: https://docs.google.com/document/d/11AyWtGhItQs6vsLRIx32PwTxmBY3libXwGXI25obVEY/edit#- Returns:
- byteSize successfully synced to underlying filesystem.
-