Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-5664

CP hooks in Scan flow for fast forward when filter filters out a row

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.92.1
    • 0.94.5, 0.95.0
    • Coprocessors, Filters
    • None
    • Reviewed
    • Hide
      This adds a new CP hook in RegionObserver , postScannerFilterRow()
      This will be called by the scan flow when the current scanned row is being filtered out by the filter.
      The filter may be filtering out the row via any of the below scenarios
      1. Filter's filterRowKey(byte [] buffer, int offset, int length) returning true so as to exclude this row
      2. At the end of the row scan filter's filterRow() returning true
      3. Filter's filterRow(List<KeyValue> kvs) removing all the kvs from the passed List making the full row to be filtered out

      This hook can be used for doing a fast forward in such a case if the user wants to do so. One can use RegionScanner#reseek(byte[] row) for doing this fast forward
      Show
      This adds a new CP hook in RegionObserver , postScannerFilterRow() This will be called by the scan flow when the current scanned row is being filtered out by the filter. The filter may be filtering out the row via any of the below scenarios 1. Filter's filterRowKey(byte [] buffer, int offset, int length) returning true so as to exclude this row 2. At the end of the row scan filter's filterRow() returning true 3. Filter's filterRow(List<KeyValue> kvs) removing all the kvs from the passed List making the full row to be filtered out This hook can be used for doing a fast forward in such a case if the user wants to do so. One can use RegionScanner#reseek(byte[] row) for doing this fast forward

    Description

      In HRegion.nextInternal(int limit, String metric)
      We have while(true) loop so as to fetch a next result which satisfies filter condition. When Filter filters out the current fetched row we call nextRow(byte [] currentRow) before going with the next row.

      	
      if (results.isEmpty() || filterRow()) {
                  // this seems like a redundant step - we already consumed the row
                  // there're no left overs.
                  // the reasons for calling this method are:
                  // 1. reset the filters.
                  // 2. provide a hook to fast forward the row (used by subclasses)
                  nextRow(currentRow);
      

      // 2. provide a hook to fast forward the row (used by subclasses)
      We can provide same feature of fast forward support for the CP also.

      Attachments

        1. HBASE-5664_94_V2.patch
          8 kB
          Anoop Sam John
        2. HBASE-5664_94_V3.patch
          7 kB
          Anoop Sam John
        3. HBASE-5664_94.patch
          7 kB
          Anoop Sam John
        4. HBASE-5664_Trunk_V2.patch
          8 kB
          Anoop Sam John
        5. HBASE-5664_Trunk.patch
          7 kB
          Anoop Sam John

        Activity

          People

            anoopsamjohn Anoop Sam John
            anoopsamjohn Anoop Sam John
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: