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
Exception
public static void tearDownAfterClass() throws Exception
Exception
public void testWALTrailer() throws IOException
IOException
private 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. nIOException
protected abstract W createWriter(org.apache.hadoop.fs.Path path) throws IOException
IOException
protected abstract void append(W writer, org.apache.hadoop.hbase.wal.WAL.Entry entry) throws IOException
IOException
protected abstract void sync(W writer) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.