Class AbstractTestProtobufLog
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.AbstractTestProtobufLog
- Direct Known Subclasses:
TestAsyncProtobufLog,TestProtobufLog
WAL tests that can be reused across providers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.junit.rules.TestNameprotected org.apache.hadoop.fs.Pathprotected org.apache.hadoop.fs.FileSystemprotected static final HBaseTestingUtilprotected org.apache.hadoop.hbase.wal.WALFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.apache.hadoop.hbase.wal.WALProvider.WritercreateWriter(org.apache.hadoop.fs.Path path) private voiddoRead(boolean withTrailer) Appends entries in the WAL and reads it.voidsetUp()static voidvoidtearDown()static voidvoidReads the WAL with and without WALTrailer.
-
Field Details
-
TEST_UTIL
-
fs
-
dir
-
wals
-
currentTest
-
-
Constructor Details
-
AbstractTestProtobufLog
public AbstractTestProtobufLog()
-
-
Method Details
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testWALTrailer
Reads the WAL with and without WALTrailer.- Throws:
IOException
-
doRead
Appends entries in the WAL and reads it.- Parameters:
withTrailer- If 'withTrailer' is true, it calls a close on the WALwriter before reading so that a trailer is appended to the WAL. Otherwise, it starts reading after the sync call. This means that reader is not aware of the trailer. In this scenario, if the reader tries to read the trailer in its next() call, it returns false from ProtoBufLogReader.- Throws:
IOException
-
createWriter
protected abstract org.apache.hadoop.hbase.wal.WALProvider.Writer createWriter(org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-