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

Ability to specify scanner caching on a per-scan basis

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.0
    • Fix Version/s: 0.20.0, 0.90.0
    • Component/s: Client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I think that clients should have the ability to configure the scanner caching setting on a per-scan basis via the org.apache.hadoop.hbase.client.Scan object. I propose adding a new caching property to the Scan class which would override the HTable.scannerCaching property if set. This would turn the HTable.scannerCaching property into more of a default setting.

      The code inside ClientScanner (an inner-class implementation of ResultScanner) would look like this:

            // Use the caching from the Scan.  If not set, use the default cache setting for this table.
            if (this.scan.getCaching() > 0) {
              this.caching = this.scan.getCaching();
            } else {
              this.caching = HTable.this.scannerCaching;
            }
      

      Note that currently the only option for per-scan scanner caching configuration is to modify the state of HTable for each Scan. This could lead to confusion when HTables are pooled since the pool would potentially end up with many HTables all configured differently.

      I will attach a patch. I'm looking forward to hearing your comments.

        Attachments

        1. HBASE-1759.patch
          5 kB
          Ken Weiner
        2. HBASE-1759-v2.patch
          5 kB
          Ken Weiner

          Activity

            People

            • Assignee:
              kweiner Ken Weiner
              Reporter:
              kweiner Ken Weiner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: