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

Enis Soztutar commented on HBASE-11679:
---------------------------------------

Sorry, back from vacation. I'll take a look. 

Personally, I would prefer we do HBASE-10602 first then do this patch, but use 
the new Table interface (which is a much better name than HTableInterface) 
{code}
interface Table {
  // get, put related stuff
}

@Deprecated
interface HTableInterface extends Table {
  // users are encouraged to use the new Table interface
}

class HTable extends Table {
  // all HTable constructors are deprecated
  // Users are not encouraged to see this class
}
{code}

HBASE-10602 is a bit more involved than just HTable changes (because 
HBaseAdmin, and HCM changes as well). I can break those out and do a quick 
patch as a subtask if you are ok. 

> Replace "HTable" with "HTableInterface" where backwards-compatible
> ------------------------------------------------------------------
>
>                 Key: HBASE-11679
>                 URL: https://issues.apache.org/jira/browse/HBASE-11679
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Carter
>            Assignee: Carter
>         Attachments: HBASE_11679.patch, HBASE_11679.patch, 
> HBASE_11679_v3.patch
>
>
> This is a refactor to move more of the code towards using interfaces for 
> proper encapsulation of logic.
> The amount of code touched is large, but it should be fairly easy to review.  
> It changes variable declarations from HTable to HTableInterface where the 
> following holds:
> # The declaration being updated won't break assignment
> # The declaration change does not break the compile (eg trying to access 
> non-interface methods)
> The two main situations are to change something like this:
> {code}
> HTable h = new HTable(c, tn);
> {code}
> to
> {code}
> HTableInterface h = new HTable(c, tn);
> {code}
> and this:
> {code}
> public void doSomething(HTable h) { ... }
> {code}
> to this:
> {code}
> public void doSomething(HTableInterface h) { ... }
> {code}
> This gets most of the obvious cases out of the way and prepares for more 
> complicated interface refactors in the future.  In method signatures, I 
> changed parameters, but did _not_ change any public or protected method 
> return values, since that would violate criteria #1 above and break 
> compatibility.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to