Class TestStoreFileWriter
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestStoreFileWriter
Store file writer does not do any compaction. Each cell written to either the live or historical
file. Regular (i.e., not-raw) scans that reads the latest put cells scans only live files. To
ensure the correctness of store file writer, we need to verify that live files includes all live
cells. This test indirectly verify this as follows. The test creates two tables, each with one
region and one store. The dual file writing (live vs historical) is configured on only one of the
tables. The test generates exact set of mutations on both tables. These mutations include all
types of cells and these cells are written to multiple files using multiple memstore flushes.
After writing all cells, the test first verify that both tables return the same set of cells for
regular and raw scans. Then the same verification is done after tables are minor and finally
major compacted. The test also verifies that flushes do not generate historical files and the
historical files are generated only when historical file generation is enabled (by the config
hbase.enable.historical.compaction.files).
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private final org.apache.hadoop.conf.Configuration
private int
private ArrayList<ArrayList<ArrayList<TestStoreFileWriter.CellInfo>>>
org.apache.hadoop.hbase.KeepDeletedCells
int
boolean
private final byte[][]
private final Random
private org.apache.hadoop.hbase.regionserver.HRegion[]
private final int
private org.apache.hadoop.hbase.TableName[]
private final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.Scan
createScan
(boolean raw) private void
createTable
(int index, boolean enableDualFileWriter) static Collection<Object[]>
data()
private void
deleteColumns
(int rowCount) private void
deleteColumnVersions
(int rowCount) private void
deleteRows
(int rowCount) private void
deleteRowVersions
(int rowCount) private void
deleteSingleRowVersion
(int row, long timestamp) private void
private long
getNewTimestamp
(long timestamp) private Long
getRowTimestamp
(int row) private void
insertRows
(int rowCount) private void
scanAndCompare
(boolean raw) void
setUp()
void
tearDown()
void
private void
-
Field Details
-
CLASS_RULE
-
ROW_NUM
- See Also:
-
RANDOM
-
testUtil
-
regions
-
qualifiers
-
insertedCells
-
tableName
-
conf
-
flushCount
-
keepDeletedCells
-
maxVersions
-
newVersionBehavior
-
-
Constructor Details
-
TestStoreFileWriter
public TestStoreFileWriter()
-
-
Method Details
-
data
-
createTable
- Throws:
IOException
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testCompactedFiles
- Throws:
Exception
-
verifyCells
- Throws:
Exception
-
flushRegion
- Throws:
Exception
-
getRowTimestamp
-
getNewTimestamp
- Throws:
Exception
-
insertRows
- Throws:
Exception
-
deleteRows
- Throws:
Exception
-
deleteSingleRowVersion
- Throws:
IOException
-
deleteRowVersions
- Throws:
Exception
-
deleteColumns
- Throws:
Exception
-
deleteColumnVersions
- Throws:
Exception
-
createScan
-
scanAndCompare
- Throws:
Exception
-