[ https://issues.apache.org/jira/browse/HBASE-8220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13618344#comment-13618344 ]
cuijianwei commented on HBASE-8220: ----------------------------------- Thanks for your review. Comments#3 looks a little complex. As you describe, if we put decrementAndGet after releaseHTableInterface, the HTable has been removed from HTable.tables while concurrentUsingTableCounts won't decrease if releaseHTableInterface throws an exception. On the other hand, if we put decrementAndGet before releaseHTableInterface, we may depend on what the users do when they getting an IOException from PoolTable.close(...). For example, if the users retries some times after this exception, concurrentUsingTableCounts will decrease many times. From this aspect, it may be a little better to put decrementAndGet after releaseHTableInterface. If HTable close fail, users should handle the exception, decide to retry until success(concurrentUsingTableCounts will decrease once eventually) or tolerate a close-fail HTable in their program(The HTable seems 'Using' by user from the view of HTablePool in this situation). On the other hand, removing the HTable from HTablePool.tables many times may not bring negative affect. > can we record the count opened HTable for HTablePool > ---------------------------------------------------- > > Key: HBASE-8220 > URL: https://issues.apache.org/jira/browse/HBASE-8220 > Project: HBase > Issue Type: Improvement > Components: Client > Affects Versions: 0.94.3 > Reporter: cuijianwei > Attachments: HBASE-8220-0.94.3.txt, HBASE-8220-0.94.3.txt > > > In HTablePool, we have a method getCurrentPoolSize(...) to get how many > opened HTable has been pooled. However, we don't know ConcurrentOpenedHTable > which means the count of HTable get from HTablePool.getTable(...) and don't > return to HTablePool by PooledTable.close(). The ConcurrentOpenedHTable may > be meaningful because it indicates how many HTables should be opened for the > application which may help us set the appropriate MaxSize of HTablePool. > Therefore, we can and a ConcurrentOpenedHTable as a counter in HTablePool. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira