public abstract class AbstractTestProtobufLog<W extends Closeable> extends Object
| Modifier and Type | Field and Description |
|---|---|
org.junit.rules.TestName |
currentTest |
protected org.apache.hadoop.fs.Path |
dir |
protected org.apache.hadoop.fs.FileSystem |
fs |
protected static HBaseTestingUtility |
TEST_UTIL |
protected org.apache.hadoop.hbase.wal.WALFactory |
wals |
| Constructor and Description |
|---|
AbstractTestProtobufLog() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
append(W writer,
org.apache.hadoop.hbase.wal.WAL.Entry entry) |
protected abstract W |
createWriter(org.apache.hadoop.fs.Path path) |
private void |
doRead(boolean withTrailer)
Appends entries in the WAL and reads it.
|
void |
setUp() |
static void |
setUpBeforeClass() |
protected abstract void |
sync(W writer) |
void |
tearDown() |
static void |
tearDownAfterClass() |
void |
testWALTrailer()
Reads the WAL with and without WALTrailer.
|
protected static final HBaseTestingUtility TEST_UTIL
protected org.apache.hadoop.fs.FileSystem fs
protected org.apache.hadoop.fs.Path dir
protected org.apache.hadoop.hbase.wal.WALFactory wals
public final org.junit.rules.TestName currentTest
public AbstractTestProtobufLog()
public static void setUpBeforeClass() throws Exception
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void testWALTrailer() throws IOException
IOExceptionprivate void doRead(boolean withTrailer) throws IOException
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. nIOExceptionprotected abstract W createWriter(org.apache.hadoop.fs.Path path) throws IOException
IOExceptionprotected abstract void append(W writer, org.apache.hadoop.hbase.wal.WAL.Entry entry) throws IOException
IOExceptionprotected abstract void sync(W writer) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.