Class TestUserScanQueryMatcher

java.lang.Object
org.apache.hadoop.hbase.regionserver.querymatcher.AbstractTestScanQueryMatcher
org.apache.hadoop.hbase.regionserver.querymatcher.TestUserScanQueryMatcher

  • Field Details

  • Constructor Details

  • Method Details

    • testNeverIncludeFakeCell

      public void testNeverIncludeFakeCell() throws IOException
      This is a cryptic test. It is checking that we don't include a fake cell. See HBASE-16074 for background.
      Throws:
      IOException
    • testMatchExplicitColumns

      public void testMatchExplicitColumns() throws IOException
      Throws:
      IOException
    • testMatch_Wildcard

      public void testMatch_Wildcard() throws IOException
      Throws:
      IOException
    • testMatch_ExpiredExplicit

      public void testMatch_ExpiredExplicit() throws IOException
      Verify that ScanQueryMatcher only 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

      public void testMatch_ExpiredWildcard() throws IOException
      Verify that ScanQueryMatcher only 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
    • testSeekOnRangeDelete

      public void testSeekOnRangeDelete() throws IOException
      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