public class TestHRegionReplayEvents extends Object
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
static org.apache.hadoop.conf.Configuration |
CONF |
protected byte[] |
cq |
private String |
dir |
private byte[][] |
families |
private org.apache.hadoop.hbase.client.TableDescriptor |
htd |
private static org.slf4j.Logger |
LOG |
protected String |
method |
org.junit.rules.TestName |
name |
private org.apache.hadoop.hbase.client.RegionInfo |
primaryHri |
private org.apache.hadoop.hbase.regionserver.HRegion |
primaryRegion |
private org.apache.hadoop.hbase.wal.WAL.Reader |
reader |
private org.apache.hadoop.fs.Path |
rootDir |
protected byte[] |
row |
protected byte[] |
row2 |
private org.apache.hadoop.hbase.regionserver.RegionServerServices |
rss |
private org.apache.hadoop.hbase.client.RegionInfo |
secondaryHri |
private org.apache.hadoop.hbase.regionserver.HRegion |
secondaryRegion |
protected byte[] |
tableName |
private static HBaseTestingUtility |
TEST_UTIL |
private long |
time |
private org.apache.hadoop.hbase.wal.WAL |
walPrimary |
private org.apache.hadoop.hbase.wal.WALFactory |
wals |
private org.apache.hadoop.hbase.wal.WAL |
walSecondary |
Constructor and Description |
---|
TestHRegionReplayEvents() |
Modifier and Type | Method and Description |
---|---|
private void |
assertPathListsEqual(List<String> list1,
List<String> list2)
Paths can be qualified or not.
|
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor |
clone(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor flush,
long flushSeqId) |
private String |
createHFileForFamilies(org.apache.hadoop.fs.Path testPath,
byte[] family,
byte[] valueBytes) |
(package private) org.apache.hadoop.hbase.wal.WAL.Reader |
createWALReaderForPrimary() |
private void |
disableReads(org.apache.hadoop.hbase.regionserver.HRegion region) |
(package private) String |
getName() |
private static org.apache.hadoop.hbase.regionserver.HRegion |
initHRegion(byte[] tableName,
byte[] startKey,
byte[] stopKey,
String callingMethod,
org.apache.hadoop.conf.Configuration conf,
boolean isReadOnly,
org.apache.hadoop.hbase.client.Durability durability,
org.apache.hadoop.hbase.wal.WAL wal,
byte[]... families) |
private static org.apache.hadoop.hbase.regionserver.HRegion |
initHRegion(byte[] tableName,
String callingMethod,
byte[]... families) |
private void |
putDataByReplay(org.apache.hadoop.hbase.regionserver.HRegion region,
int startRow,
int numRows,
byte[] qf,
byte[]... families) |
private void |
putDataWithFlushes(org.apache.hadoop.hbase.regionserver.HRegion region,
int flushInterval,
int numRows,
int numRowsAfterFlush)
Puts a total of numRows + numRowsAfterFlush records indexed with numeric row keys.
|
private void |
replay(org.apache.hadoop.hbase.regionserver.HRegion region,
org.apache.hadoop.hbase.client.Put put,
long replaySeqId) |
(package private) static int |
replayEdit(org.apache.hadoop.hbase.regionserver.HRegion region,
org.apache.hadoop.hbase.wal.WAL.Entry entry) |
void |
setup() |
void |
tearDown() |
void |
testBatchReplayWithMultipleNonces() |
void |
testOnlyReplayingFlushStartDoesNotHoldUpRegionClose()
Tests a case where we replay only a flush start marker, then the region is closed.
|
void |
testRefresStoreFiles() |
void |
testRegionReadsEnabledFlag()
Tests the reads enabled flag for the region.
|
void |
testRegionReplicaSecondaryCannotFlush() |
void |
testReplayBulkLoadEvent()
Tests replaying region open markers from primary region.
|
void |
testReplayFlushCommitMarkerLargerThanFlushStartMarker()
Tests the case where we prepare a flush with some seqId and we receive a flush commit marker
larger than the previous flush start marker.
|
void |
testReplayFlushCommitMarkerSmallerThanFlushStartMarker()
Tests the case where we prepare a flush with some seqId and we receive a flush commit marker
less than the previous flush start marker.
|
void |
testReplayFlushCommitMarkerWithoutFlushStartMarker(boolean droppableMemstore)
Tests the case where we receive a flush commit before receiving any flush prepare markers
|
void |
testReplayFlushCommitMarkerWithoutFlushStartMarkerDroppableMemstore()
Tests the case where we receive a flush commit before receiving any flush prepare markers.
|
void |
testReplayFlushCommitMarkerWithoutFlushStartMarkerNonDroppableMemstore()
Tests the case where we receive a flush commit before receiving any flush prepare markers.
|
void |
testReplayFlushesAndCompactions() |
void |
testReplayFlushSeqIds() |
void |
testReplayFlushStartMarkers()
Tests cases where we prepare a flush with some seqId and we receive other flush start markers
equal to, greater or less than the previous flush start marker.
|
void |
testReplayingBulkLoadEventWithFileAlreadyDeleted() |
void |
testReplayingCompactionWithFileAlreadyDeleted() |
void |
testReplayingFlushCommitWithFileAlreadyDeleted() |
void |
testReplayingFlushRequestRestoresReadsEnabledState()
Test the case where the secondary region replica is not in reads enabled state because it is
waiting for a flush or region open marker from primary region.
|
void |
testReplayingFlushRestoresReadsEnabledState()
Test the case where the secondary region replica is not in reads enabled state because it is
waiting for a flush or region open marker from primary region.
|
void |
testReplayingFlushWithEmptyMemstoreRestoresReadsEnabledState()
Test the case where the secondary region replica is not in reads enabled state because it is
waiting for a flush or region open marker from primary region.
|
void |
testReplayingRegionOpenEventRestoresReadsEnabledState()
Test the case where the secondary region replica is not in reads enabled state because it is
waiting for a flush or region open marker from primary region.
|
void |
testReplayingRegionOpenEventWithFileAlreadyDeleted() |
void |
testReplayRegionOpenEvent()
Tests replaying region open markers from primary region.
|
void |
testReplayRegionOpenEventAfterFlushStart()
Tests the case where we replay a region open event after a flush start but before receiving
flush commit
|
void |
testSecondaryRegionDoesNotWriteRegionEventsToWAL()
Tests that a region opened in secondary mode would not write region open / close
events to its WAL.
|
void |
testSeqIdsFromReplay() |
void |
testSkippingEditsWithSmallerSeqIdAfterRegionOpenEvent()
Tests whether edits coming in for replay are skipped which have smaller seq id than the seqId
of the last replayed region open event.
|
void |
testWriteFlushRequestMarker()
Tests the case where a request for flush cache is sent to the region, but region cannot flush.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
public org.junit.rules.TestName name
private static HBaseTestingUtility TEST_UTIL
public static org.apache.hadoop.conf.Configuration CONF
private byte[][] families
protected byte[] tableName
protected final byte[] row
protected final byte[] row2
protected byte[] cq
private org.apache.hadoop.fs.Path rootDir
private org.apache.hadoop.hbase.client.TableDescriptor htd
private long time
private org.apache.hadoop.hbase.regionserver.RegionServerServices rss
private org.apache.hadoop.hbase.client.RegionInfo primaryHri
private org.apache.hadoop.hbase.client.RegionInfo secondaryHri
private org.apache.hadoop.hbase.regionserver.HRegion primaryRegion
private org.apache.hadoop.hbase.regionserver.HRegion secondaryRegion
private org.apache.hadoop.hbase.wal.WALFactory wals
private org.apache.hadoop.hbase.wal.WAL walPrimary
private org.apache.hadoop.hbase.wal.WAL walSecondary
private org.apache.hadoop.hbase.wal.WAL.Reader reader
public TestHRegionReplayEvents()
public void setup() throws IOException
IOException
public void testRegionReplicaSecondaryCannotFlush() throws IOException
IOException
public void testOnlyReplayingFlushStartDoesNotHoldUpRegionClose() throws IOException
IOException
static int replayEdit(org.apache.hadoop.hbase.regionserver.HRegion region, org.apache.hadoop.hbase.wal.WAL.Entry entry) throws IOException
IOException
org.apache.hadoop.hbase.wal.WAL.Reader createWALReaderForPrimary() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public void testBatchReplayWithMultipleNonces() throws IOException
IOException
public void testReplayFlushesAndCompactions() throws IOException
IOException
public void testReplayFlushStartMarkers() throws IOException
IOException
public void testReplayFlushCommitMarkerSmallerThanFlushStartMarker() throws IOException
IOException
public void testReplayFlushCommitMarkerLargerThanFlushStartMarker() throws IOException
IOException
public void testReplayFlushCommitMarkerWithoutFlushStartMarkerDroppableMemstore() throws IOException
IOException
public void testReplayFlushCommitMarkerWithoutFlushStartMarkerNonDroppableMemstore() throws IOException
IOException
public void testReplayFlushCommitMarkerWithoutFlushStartMarker(boolean droppableMemstore) throws IOException
IOException
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor clone(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor flush, long flushSeqId)
public void testReplayRegionOpenEvent() throws IOException
IOException
public void testReplayRegionOpenEventAfterFlushStart() throws IOException
IOException
public void testSkippingEditsWithSmallerSeqIdAfterRegionOpenEvent() throws IOException
IOException
public void testReplayFlushSeqIds() throws IOException
IOException
public void testSeqIdsFromReplay() throws IOException
IOException
public void testSecondaryRegionDoesNotWriteRegionEventsToWAL() throws IOException
IOException
public void testRegionReadsEnabledFlag() throws IOException
IOException
public void testWriteFlushRequestMarker() throws IOException
IOException
public void testReplayingFlushRequestRestoresReadsEnabledState() throws IOException
IOException
public void testReplayingFlushRestoresReadsEnabledState() throws IOException
IOException
public void testReplayingFlushWithEmptyMemstoreRestoresReadsEnabledState() throws IOException
IOException
public void testReplayingRegionOpenEventRestoresReadsEnabledState() throws IOException
IOException
public void testRefresStoreFiles() throws IOException
IOException
private void assertPathListsEqual(List<String> list1, List<String> list2)
private void disableReads(org.apache.hadoop.hbase.regionserver.HRegion region)
private void replay(org.apache.hadoop.hbase.regionserver.HRegion region, org.apache.hadoop.hbase.client.Put put, long replaySeqId) throws IOException
IOException
public void testReplayBulkLoadEvent() throws IOException
IOException
public void testReplayingFlushCommitWithFileAlreadyDeleted() throws IOException
IOException
public void testReplayingCompactionWithFileAlreadyDeleted() throws IOException
IOException
public void testReplayingRegionOpenEventWithFileAlreadyDeleted() throws IOException
IOException
public void testReplayingBulkLoadEventWithFileAlreadyDeleted() throws IOException
IOException
private String createHFileForFamilies(org.apache.hadoop.fs.Path testPath, byte[] family, byte[] valueBytes) throws IOException
IOException
private void putDataWithFlushes(org.apache.hadoop.hbase.regionserver.HRegion region, int flushInterval, int numRows, int numRowsAfterFlush) throws IOException
IOException
private void putDataByReplay(org.apache.hadoop.hbase.regionserver.HRegion region, int startRow, int numRows, byte[] qf, byte[]... families) throws IOException
IOException
private static org.apache.hadoop.hbase.regionserver.HRegion initHRegion(byte[] tableName, String callingMethod, byte[]... families) throws IOException
IOException
private static org.apache.hadoop.hbase.regionserver.HRegion initHRegion(byte[] tableName, byte[] startKey, byte[] stopKey, String callingMethod, org.apache.hadoop.conf.Configuration conf, boolean isReadOnly, org.apache.hadoop.hbase.client.Durability durability, org.apache.hadoop.hbase.wal.WAL wal, byte[]... families) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.