[
https://issues.apache.org/jira/browse/HBASE-11068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13980028#comment-13980028
]
Enis Soztutar commented on HBASE-11068:
---------------------------------------
Nice. Let me take a look.
Linked HBASE-10602. Carter you may want to take a look at that patch to see
where I want to take the client API direction.
bq. Admin admin = HConnectionManager.createConnection(conf).getAdmin();
One thing is that, we cannot do a blanket change everywhere like this. Two
problems, (a) we do not want to create a new connection everytime we need an
admin, but instead create connection in the test, that all tables and admins
share; (b) we want to close the connection after we are done.
bq. If big, single-patch refactors like this are not the custom or there are
other fundamental problems, please let me know. You won't hurt my feelings
It would be ok as long as it is doing one thing. You can break up for review
convenience if you feel that it will be hard to review.
> Update code to use Admin factory method instead of constructor
> --------------------------------------------------------------
>
> Key: HBASE-11068
> URL: https://issues.apache.org/jira/browse/HBASE-11068
> Project: HBase
> Issue Type: Improvement
> Reporter: Carter
> Assignee: Carter
> Attachments: HBASE_11068.patch
>
>
> Where feasible, the code should be updated to use the HConnection factory
> method for the admin interface. For instance, the following:
> {code:java}
> HBaseAdmin admin = new HBaseAdmin(conf);
> {code}
> would be changed to:
> {code:java}
> Admin admin = HConnectionManager.createConnection(conf).getAdmin();
> {code}
> This would also require updates to admin calls that refer to a tablename as
> byte[] or String.
> {code:java}
> admin.enableTable("mytable");
> {code}
> would change to:
> {code:java}
> admin.enableTable(TableName.valueOf("mytable"));
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)