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
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static byte[]private static org.apache.hadoop.fs.FileSystemprivate static byte[]private static org.apache.hadoop.hbase.client.RegionInfoprivate static byte[]private static org.apache.hadoop.hbase.TableNameprivate static final HBaseCommonTestingUtilityprivate static byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertEntryEquals(org.apache.hadoop.hbase.wal.WAL.Entry entry, int index) private org.apache.hadoop.fs.PathgenerateBrokenWALFile(byte[] content, int length) static voidsetUp()static voidtearDown()voidprivate voidtestReadEntry(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
-