Package org.apache.hadoop.hbase.wal
Class TestParsePartialWALFile
java.lang.Object
org.apache.hadoop.hbase.wal.TestParsePartialWALFile
In this test, we write a small WAL file first, and then generate partial WAL file which length is
in range [0, fileLength)(we test all the possible length in the range), to see if we can
successfully get the completed entries, and also get an EOF at the end.
It is very important to make sure 3 things:
- We do not get incorrect entries. Otherwise there will be data corruption.
- We can get all the completed entries, i.e, we do not miss some data. Otherwise there will be data loss.
- We will get an EOF finally, instead of a general IOException. Otherwise the split or replication will be stuck.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static byte[]
private static org.apache.hadoop.fs.FileSystem
private static byte[]
private static org.apache.hadoop.hbase.client.RegionInfo
private static byte[]
private static org.apache.hadoop.hbase.TableName
private static final HBaseCommonTestingUtil
private static byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertEntryEquals
(org.apache.hadoop.hbase.wal.WAL.Entry entry, int index) private org.apache.hadoop.fs.Path
generateBrokenWALFile
(byte[] content, int length) static void
setUp()
static void
tearDown()
void
private void
testReadEntry
(org.apache.hadoop.fs.Path file, int entryCount)
-
Field Details
-
CLASS_RULE
-
UTIL
-
FS
-
TN
-
RI
-
ROW
-
FAMILY
-
QUAL
-
VALUE
-
-
Constructor Details
-
TestParsePartialWALFile
public TestParsePartialWALFile()
-
-
Method Details
-
setUp
- Throws:
IOException
-
tearDown
-
generateBrokenWALFile
private org.apache.hadoop.fs.Path generateBrokenWALFile(byte[] content, int length) throws IOException - Throws:
IOException
-
assertEntryEquals
-
testReadEntry
- Throws:
IOException
-
testPartialParse
- Throws:
Exception
-