HBase
  1. HBase
  2. HBASE-6580

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.6, 0.95.0
    • Fix Version/s: 0.98.0, 0.95.2, 0.94.11
    • 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.

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

        Issue Links

          Activity

          Lars Hofhansl created issue -
          Lars Hofhansl made changes -
          Field Original Value New Value
          Summary New HTable pools, based on HBase(byte[], HConnection, ExecutorService) constructor New HTable pool, based on HBase(byte[], HConnection, ExecutorService) constructor
          Lars Hofhansl made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Fix Version/s 0.96.0 [ 12320040 ]
          Fix Version/s 0.94.2 [ 12321884 ]
          Adrian Muraru made changes -
          Link This issue depends on HBASE-4805 [ HBASE-4805 ]
          Adrian Muraru made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Release Note New HTableInterfaceFactory implementation using shared ExecutorService for all HTable instances managed by HTablePool
          Affects Version/s 0.94.2 [ 12321884 ]
          Affects Version/s 0.92.2 [ 12319888 ]
          Adrian Muraru made changes -
          Attachment HBASE-6580_v1.patch [ 12554094 ]
          Adrian Muraru made changes -
          Link This issue is related to HBASE-6956 [ HBASE-6956 ]
          Adrian Muraru made changes -
          Attachment HBASE_v2.patch [ 12555579 ]
          Adrian Muraru made changes -
          Attachment HBASE_v2.patch [ 12555579 ]
          Adrian Muraru made changes -
          Attachment HBASE-6580_v2.patch [ 12555580 ]
          Lars Hofhansl made changes -
          Link This issue relates to HBASE-7463 [ HBASE-7463 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.96.0 [ 12320040 ]
          Fix Version/s 0.94.5 [ 12323874 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.6 [ 12323907 ]
          Fix Version/s 0.94.5 [ 12323874 ]
          stack made changes -
          Fix Version/s 0.95.0 [ 12324094 ]
          Fix Version/s 0.96.0 [ 12320040 ]
          Fix Version/s 0.94.6 [ 12323907 ]
          Lars Hofhansl made changes -
          Affects Version/s 0.95.0 [ 12324094 ]
          Affects Version/s 0.94.6 [ 12323907 ]
          Affects Version/s 0.92.2 [ 12319888 ]
          Affects Version/s 0.94.2 [ 12321884 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.6 [ 12323907 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.2 [ 12321884 ]
          Fix Version/s 0.94.6 [ 12323907 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.6 [ 12323907 ]
          Fix Version/s 0.94.2 [ 12321884 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.7 [ 12324039 ]
          Fix Version/s 0.94.6 [ 12323907 ]
          stack made changes -
          Fix Version/s 0.95.1 [ 12324288 ]
          Fix Version/s 0.94.7 [ 12324039 ]
          Fix Version/s 0.95.0 [ 12324094 ]
          stack made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Gavin made changes -
          Link This issue depends on HBASE-4805 [ HBASE-4805 ]
          Gavin made changes -
          Link This issue depends upon HBASE-4805 [ HBASE-4805 ]
          stack made changes -
          Fix Version/s 0.95.2 [ 12320040 ]
          Fix Version/s 0.95.1 [ 12324288 ]
          Lars Hofhansl made changes -
          Assignee Lars Hofhansl [ lhofhansl ]
          Lars Hofhansl made changes -
          Fix Version/s 0.98.0 [ 12323143 ]
          Fix Version/s 0.94.11 [ 12324741 ]
          Lars Hofhansl made changes -
          Summary New HTable pool, based on HBase(byte[], HConnection, ExecutorService) constructor Deprecate HTablePool in favor of HConnection.getHTable(...)
          Lars Hofhansl made changes -
          Description 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.
          Update:
          I now propose deprecating HTablePool and instead introduce a getTable

          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.

          Lars Hofhansl made changes -
          Summary Deprecate HTablePool in favor of HConnection.getHTable(...) Deprecate HTablePool in favor of HConnection.getTable(...)
          Lars Hofhansl made changes -
          Description Update:
          I now propose deprecating HTablePool and instead introduce a getTable

          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.

          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.

          Lars Hofhansl made changes -
          Attachment 6580-trunk.txt [ 12595554 ]
          Lars Hofhansl made changes -
          Link This issue relates to HBASE-9117 [ HBASE-9117 ]
          Ted Yu made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          Lars Hofhansl made changes -
          Attachment 6580-trunk-v2.txt [ 12595834 ]
          Lars Hofhansl made changes -
          Attachment 6580-trunk-v3.txt [ 12595845 ]
          Lars Hofhansl made changes -
          Attachment 6580-trunk-v4.txt [ 12595855 ]
          Lars Hofhansl made changes -
          Attachment 6580-trunk-v5.txt [ 12596185 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.12 [ 12324790 ]
          Fix Version/s 0.94.11 [ 12324741 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Attachment 6580-0.94.txt [ 12596487 ]
          Lars Hofhansl made changes -
          Attachment 6580-0.94-v2.txt [ 12596664 ]
          Lars Hofhansl made changes -
          Attachment 6580-trunk-v6.txt [ 12596665 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.11 [ 12324741 ]
          Fix Version/s 0.94.12 [ 12324790 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags Reviewed [ 10343 ]
          Release Note New HTableInterfaceFactory implementation using shared ExecutorService for all HTable instances managed by HTablePool
          Resolution Fixed [ 1 ]
          Lars Hofhansl made changes -
          Release Note 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.
          Lars Hofhansl made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development