[ 
https://issues.apache.org/jira/browse/HBASE-1655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731271#action_12731271
 ] 

Ken Weiner commented on HBASE-1655:
-----------------------------------

A few questions/comments on the comments:
- Why does the key to a HashMap need a comparator?
- I much prefer the type of String vs byte[] for the tableName throughout all 
the method signatures and as a key to the internal map, but I tried to keep it 
as-is because it seemed to fit more with other HBase code. Can we just change 
it to String throughout and go back to the HashMap?
- I am not a fan of the current API either.  I'd much prefer that the 
HTablePool be instantiated by a client and we get rid of the static methods and 
static Map altogether.  This fits in much more nicely for people like me who 
are using IoC containers like Spring.  It also allows the ability to have 
multiple HTablePool instances, maybe each with their own configuration (which 
is currently just the max size).
- Sorry about the tab/spaces issue.  I didn't clean it up carefully enough.
- Sorry about the reordering of imports.   I use Eclipse which does this 
automatically and I was too lazy to try to restore the order back to the way it 
was.  I'll try harder next time.

So what is the next step?  Should I make a new patch with an HTablePool that is 
meant to be instantiated and w/o the static methods?


> Usability improvements to HTablePool
> ------------------------------------
>
>                 Key: HBASE-1655
>                 URL: https://issues.apache.org/jira/browse/HBASE-1655
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Ken Weiner
>            Assignee: Ken Weiner
>         Attachments: HBASE-1655-v2-partial.patch, HBASE-1655.patch
>
>
> A discussion on the HBase user mailing list 
> (http://markmail.org/thread/7leeha56ny5mwecg) led to some suggested 
> improvements for the org.apache.hadoop.hbase.client.HTablePool class.
> I will be submitting a patch that contains the following changes to 
> HTablePool:
> * Remove constructors that were not used.
> * Change access to remaining contstructor from public to private to enforce 
> use of the static factory method getPool.
> * Change internal map from TreeMap to HashMap because I couldn't see any 
> reason it needed to be sorted.
> * Remove HBaseConfiguration and tableName member variables since they aren't 
> really properties of the pool itself. They are associated with the HTable 
> that should get instantiated when one is requested from the pool, but not 
> already there.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to