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
Modifier and TypeFieldDescriptionfinal org.junit.rules.TestName
protected org.apache.hadoop.fs.Path
protected org.apache.hadoop.fs.FileSystem
protected static final HBaseTestingUtil
protected org.apache.hadoop.hbase.wal.WALFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.apache.hadoop.hbase.wal.WALProvider.Writer
createWriter
(org.apache.hadoop.fs.Path path) private void
doRead
(boolean withTrailer) Appends entries in the WAL and reads it.void
setUp()
static void
void
tearDown()
static void
void
Reads 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
-