Class TestUserScanQueryMatcher
java.lang.Object
org.apache.hadoop.hbase.regionserver.querymatcher.AbstractTestScanQueryMatcher
org.apache.hadoop.hbase.regionserver.querymatcher.TestUserScanQueryMatcher
@Tag("org.apache.hadoop.hbase.testclassification.RegionServerTests") @Tag("org.apache.hadoop.hbase.testclassification.SmallTests")
public class TestUserScanQueryMatcher
extends AbstractTestScanQueryMatcher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertAllSkip(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells, org.apache.hadoop.hbase.KeyValue.Type type, int count) All markers should SKIP regardless of count.private voidassertSeekAfterThreshold(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells, org.apache.hadoop.hbase.KeyValue.Type type, int n) First n-1 markers SKIP, n-th triggers SEEK_NEXT_COL.private org.apache.hadoop.hbase.regionserver.querymatcher.UserScanQueryMatchercreateDeleteMatcher(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells) voidDeleteColumn markers for different qualifiers should not accumulate the seek counter.voidDeleteColumn with empty qualifier must not cause seeking past a subsequent DeleteFamily.voidVerify thatScanQueryMatcheronly skips expired KeyValue instances and does not exit early from the row (skipping later non-expired KeyValues).voidVerify thatScanQueryMatcheronly skips expired KeyValue instances and does not exit early from the row (skipping later non-expired KeyValues).voidvoidvoidvoidHere is the unit test for UserScanQueryMatcher#mergeFilterResponse, when the number of cells exceed the versions requested in scan, we should return SEEK_NEXT_COL, but if current match code is INCLUDE_AND_SEEK_NEXT_ROW, we can optimize to choose the max step between SEEK_NEXT_COL and INCLUDE_AND_SEEK_NEXT_ROW, which is SEEK_NEXT_ROW.voidHere is the unit test for UserScanQueryMatcher#mergeFilterResponse: the match code may be changed to SEEK_NEXT_COL or INCLUDE_AND_SEEK_NEXT_COL after merging with filterResponse, even if the passed match code is neither SEEK_NEXT_COL nor INCLUDE_AND_SEEK_NEXT_COL.voidThis is a cryptic test.voidVerify that the normal filterCell/getNextCellHint path is unaffected by pendingSkipHint.voidVerify that a null getSkipHint falls back to the original SKIP match code.voidVerify that pendingSkipHint is cleared when a row transition occurs via setToNewRow.voidAfter enough consecutive range delete markers, the matcher should switch from SKIP to SEEK_NEXT_COL.voidDelete markers outside the scan's time range (includeDeleteMarker=false) should still accumulate the seek counter and trigger SEEK_NEXT_COL after the threshold.voidVerify that getSkipHint is consulted when a cell is newer than the time-range upper bound.voidVerify that getSkipHint is consulted when a cell is older than the time-range lower bound.voidVerify that getSkipHint is consulted when a column is excluded by the scan's column set.voidVerify that getSkipHint works correctly for reversed scans (hint must be smaller).voidVerify that getSkipHint is consulted when the version limit is exhausted.Methods inherited from class org.apache.hadoop.hbase.regionserver.querymatcher.AbstractTestScanQueryMatcher
setUp
-
Field Details
-
LOG
-
-
Constructor Details
-
TestUserScanQueryMatcher
public TestUserScanQueryMatcher()
-
-
Method Details
-
testNeverIncludeFakeCell
This is a cryptic test. It is checking that we don't include a fake cell. See HBASE-16074 for background.- Throws:
IOException
-
testMatchExplicitColumns
- Throws:
IOException
-
testMatch_Wildcard
- Throws:
IOException
-
testMatch_ExpiredExplicit
Verify thatScanQueryMatcheronly skips expired KeyValue instances and does not exit early from the row (skipping later non-expired KeyValues). This version mimics a Get with explicitly specified column qualifiers.- Throws:
IOException
-
testMatch_ExpiredWildcard
Verify thatScanQueryMatcheronly skips expired KeyValue instances and does not exit early from the row (skipping later non-expired KeyValues). This version mimics a Get with wildcard-inferred column qualifiers.- Throws:
IOException
-
testMatchWhenFilterReturnsIncludeAndSeekNextRow
- Throws:
IOException
-
testMergeFilterResponseCase1
Here is the unit test for UserScanQueryMatcher#mergeFilterResponse, when the number of cells exceed the versions requested in scan, we should return SEEK_NEXT_COL, but if current match code is INCLUDE_AND_SEEK_NEXT_ROW, we can optimize to choose the max step between SEEK_NEXT_COL and INCLUDE_AND_SEEK_NEXT_ROW, which is SEEK_NEXT_ROW.- Throws:
IOException
-
testMergeFilterResponseCase2
Here is the unit test for UserScanQueryMatcher#mergeFilterResponse: the match code may be changed to SEEK_NEXT_COL or INCLUDE_AND_SEEK_NEXT_COL after merging with filterResponse, even if the passed match code is neither SEEK_NEXT_COL nor INCLUDE_AND_SEEK_NEXT_COL. In that case, we need to make sure that the ColumnTracker has been switched to the next column.
An effective test way is: we only need to check the cell from getKeyForNextColumn(). because that as long as the UserScanQueryMatcher returns SEEK_NEXT_COL or INCLUDE_AND_SEEK_NEXT_COL, UserScanQueryMatcher#getKeyForNextColumn should return an cell whose column is larger than the current cell's.- Throws:
Exception
-
testSkipHintConsultedForCellNewerThanTimeRange
Verify that getSkipHint is consulted when a cell is newer than the time-range upper bound.- Throws:
IOException
-
testSkipHintConsultedForCellOlderThanTimeRange
Verify that getSkipHint is consulted when a cell is older than the time-range lower bound.- Throws:
IOException
-
testNullSkipHintFallsThroughToOriginalCodeOnTimeRangeGate
Verify that a null getSkipHint falls back to the original SKIP match code.- Throws:
IOException
-
testSkipHintConsultedForExcludedColumn
Verify that getSkipHint is consulted when a column is excluded by the scan's column set.- Throws:
IOException
-
testSkipHintConsultedOnVersionExhaustion
Verify that getSkipHint is consulted when the version limit is exhausted.- Throws:
IOException
-
testPendingSkipHintClearedOnRowTransition
Verify that pendingSkipHint is cleared when a row transition occurs via setToNewRow.- Throws:
IOException
-
testNormalFilterCellHintPathUnaffectedBySkipHintChange
Verify that the normal filterCell/getNextCellHint path is unaffected by pendingSkipHint.- Throws:
IOException
-
testSkipHintConsultedForReversedScan
Verify that getSkipHint works correctly for reversed scans (hint must be smaller).- Throws:
IOException
-
testSeekOnRangeDelete
After enough consecutive range delete markers, the matcher should switch from SKIP to SEEK_NEXT_COL. Point deletes and KEEP_DELETED_CELLS always SKIP.- Throws:
IOException
-
testDeleteColumnEmptyQualifierDoesNotSkipDeleteFamily
DeleteColumn with empty qualifier must not cause seeking past a subsequent DeleteFamily. DeleteFamily masks all columns, so it must be tracked by the delete tracker.- Throws:
IOException
-
testDeleteColumnDifferentQualifiersDoNotSeek
DeleteColumn markers for different qualifiers should not accumulate the seek counter. Only consecutive markers for the same qualifier should trigger seeking.- Throws:
IOException
-
testSeekOnRangeDeleteOutsideTimeRange
Delete markers outside the scan's time range (includeDeleteMarker=false) should still accumulate the seek counter and trigger SEEK_NEXT_COL after the threshold.- Throws:
IOException
-
createDeleteMatcher
private org.apache.hadoop.hbase.regionserver.querymatcher.UserScanQueryMatcher createDeleteMatcher(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells) throws IOException - Throws:
IOException
-
assertSeekAfterThreshold
private void assertSeekAfterThreshold(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells, org.apache.hadoop.hbase.KeyValue.Type type, int n) throws IOException First n-1 markers SKIP, n-th triggers SEEK_NEXT_COL.- Throws:
IOException
-
assertAllSkip
private void assertAllSkip(org.apache.hadoop.hbase.KeepDeletedCells keepDeletedCells, org.apache.hadoop.hbase.KeyValue.Type type, int count) throws IOException All markers should SKIP regardless of count.- Throws:
IOException
-