hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carter (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-11068) Update code to use Admin factory method instead of constructor
Date Thu, 24 Apr 2014 17:45:16 GMT

     [ https://issues.apache.org/jira/browse/HBASE-11068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Carter updated HBASE-11068:

    Status: Patch Available  (was: In Progress)

Here's a stab.  A couple of notes:

 * This isn't everything, since this can be done in one go, but it sets a direction.
 * In many places I've changed a method parameter from HBaseAdmin to Admin.  This should be
backwards compatible with users since HBaseAdmin now implements the interface.
 * There is only one non-private method where I changed the return type, {code}RESTServlet#getAdmin(){code}.
 It's default scope, so I think it's probably safe, but it's possible for a user to create
third party class with that package and access it.  Something to consider in review.
 * 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.  :-)

> 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
> {code:java}
>     admin.enableTable("mytable");
> {code}
> would change to:
> {code:java}
>     admin.enableTable(TableName.valueOf("mytable"));
> {code}

This message was sent by Atlassian JIRA

View raw message