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

Heng Chen commented on HBASE-14203:
-----------------------------------

{quote}
Creating an Admin is a costly operation. Maybe we can extract the method to be 
a static one.
{quote}

Thanks for your reply!

I check the code, it has some difficulty to extract {{getTableDescriptor}} to 
be a static one. Because in this function it calls non-static function. To 
avoid create {{Admin}} every time when call {{Connection.getAdmin()}}, we can 
use Singleton instance.

I update the patch. 



> remove duplicate code getTableDescriptor in HTable
> --------------------------------------------------
>
>                 Key: HBASE-14203
>                 URL: https://issues.apache.org/jira/browse/HBASE-14203
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Heng Chen
>            Priority: Trivial
>         Attachments: HBASE-14203.patch, HBASE-14203_v2.patch
>
>
> As TODO in comment said, 
> {{HTable.getTableDescriptor}} is same as {{HAdmin.getTableDescriptor}}. 
> remove the duplicate code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to