[
https://issues.apache.org/jira/browse/HBASE-1341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705456#action_12705456
]
Jonathan Gray commented on HBASE-1341:
--------------------------------------
Sorry was not following the issue.
Looks good, Andrew. Very straightforward.
We have a much more complex class we use called HBaseRef. It pools HTables for
all your tables, so you just pass a single object around in your code rather
than one per table. Besides that it behaves very similarly.
One thing I used in a recent modification to HBaseRef was differentiating
read/write HTable instances (in benchmarking, no performance hit sharing a
single HTable for reads but there is for concurrent writes). Just returned the
same one for reads but a growing list for writers. Not sure if this is
necessary but it was good to have in some cases.
Is there a way to note in the javadoc what the default is if you don't set
maxSize?
Regarding the locks, I'd prefer to synchronize the object and ensure
correctness. If not, advertise the fact that there can be indeterminate
behavior. I just don't like an optimization like that not done by or known by
the user. A bunch of threads using the HTablePool at the same moment is
probably the most common use case.
> Create HTable Pooler
> --------------------
>
> Key: HBASE-1341
> URL: https://issues.apache.org/jira/browse/HBASE-1341
> Project: Hadoop HBase
> Issue Type: New Feature
> Components: client, io
> Reporter: Jonathan Gray
> Priority: Minor
> Fix For: 0.20.0
>
> Attachments: hbase-1341-2.patch, hbase-1341.patch
>
>
> A client class that takes care of properly pooling HTable references for use
> in multi-threaded, low-latency Java clients.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.