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

Deprecate HTablePool in favor of HConnection.getTable(...)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.6, 0.95.0
    • Fix Version/s: 0.98.0, 0.95.2, 0.94.11, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      This issue introduces a few new APIs:
      * HConnectionManager:
      {code}
          public static HConnection createConnection(Configuration conf)
          public static HConnection createConnection(Configuration conf, ExecutorService pool)
      {code}
      * HConnection:
      {code}
          public HTableInterface getTable(String tableName) throws IOException
          public HTableInterface getTable(byte[] tableName) throws IOException
          public HTableInterface getTable(String tableName, ExecutorService pool) throws IOException
          public HTableInterface getTable(byte[] tableName, ExecutorService pool) throws IOException
      {code}

      By default HConnectionImplementation will create an ExecutorService when needed. The ExecutorService can optionally passed be passed in.
      HTableInterfaces are retrieved from the HConnection. By default the HConnection's ExecutorService is used, but optionally that can be overridden for each HTable.
      Show
      This issue introduces a few new APIs: * HConnectionManager: {code}     public static HConnection createConnection(Configuration conf)     public static HConnection createConnection(Configuration conf, ExecutorService pool) {code} * HConnection: {code}     public HTableInterface getTable(String tableName) throws IOException     public HTableInterface getTable(byte[] tableName) throws IOException     public HTableInterface getTable(String tableName, ExecutorService pool) throws IOException     public HTableInterface getTable(byte[] tableName, ExecutorService pool) throws IOException {code} By default HConnectionImplementation will create an ExecutorService when needed. The ExecutorService can optionally passed be passed in. HTableInterfaces are retrieved from the HConnection. By default the HConnection's ExecutorService is used, but optionally that can be overridden for each HTable.

      Description

      Update:
      I now propose deprecating HTablePool and instead introduce a getTable method on HConnection and allow HConnection to manage the ThreadPool.

      Initial proposal:
      Here I propose a very simple TablePool.
      It could be called LightHTablePool (or something - if you have a better name).
      Internally it would maintain an HConnection and an Executor service and each invocation of getTable(...) would create a new HTable and close() would just close it.
      In testing I find this more light weight than HTablePool and easier to monitor in terms of resources used.

      It would hardly be more than a few dozen lines of code.

        Attachments

        1. 6580-0.94.txt
          20 kB
          Lars Hofhansl
        2. 6580-0.94-v2.txt
          20 kB
          Lars Hofhansl
        3. 6580-trunk.txt
          10 kB
          Lars Hofhansl
        4. 6580-trunk-v2.txt
          20 kB
          Lars Hofhansl
        5. 6580-trunk-v3.txt
          22 kB
          Lars Hofhansl
        6. 6580-trunk-v4.txt
          21 kB
          Lars Hofhansl
        7. 6580-trunk-v5.txt
          24 kB
          Lars Hofhansl
        8. 6580-trunk-v6.txt
          24 kB
          Lars Hofhansl
        9. HBASE-6580_v1.patch
          10 kB
          Adrian Muraru
        10. HBASE-6580_v2.patch
          7 kB
          Adrian Muraru

          Issue Links

            Activity

              People

              • Assignee:
                lhofhansl Lars Hofhansl
                Reporter:
                lhofhansl Lars Hofhansl
              • Votes:
                0 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: