public abstract class AbstractTestProtobufLog 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 HBaseTestingUtil |
TEST_UTIL |
protected org.apache.hadoop.hbase.wal.WALFactory |
wals |
Constructor and Description |
---|
AbstractTestProtobufLog() |
Modifier and Type | Method and Description |
---|---|
protected 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 |
setUpBeforeClass() |
void |
tearDown() |
static void |
tearDownAfterClass() |
void |
testWALTrailer()
Reads the WAL with and without WALTrailer.
|
protected static final HBaseTestingUtil 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.IOException
protected abstract org.apache.hadoop.hbase.wal.WALProvider.Writer createWriter(org.apache.hadoop.fs.Path path) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.