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

Carter commented on HBASE-11879:
--------------------------------

One other alternative I'll throw out there.  Rather than passing the individual 
Table and RegionLocator interfaces, it would be possible to throw out the 
Connection interface and HIFB can use that to retrieve the Admin and Table 
interfaces for itself.

Option 2:

{code}
protected Connection getConnection();
protected void setConnection(Connection connection);
{code}


> Change TableInputFormatBase to take interface arguments
> -------------------------------------------------------
>
>                 Key: HBASE-11879
>                 URL: https://issues.apache.org/jira/browse/HBASE-11879
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Carter
>            Assignee: Carter
>
> As part of the ongoing interface abstraction work, I'm now investigating 
> {{TableInputFormatBase}}, which has two methods that break encapsulation:
> {code}
> protected HTable getHTable();
> protected void setHTable(HTable table);
> {code}
> While these are protected methods, the base @InterfaceAudience.Public is 
> abstract, meaning that it supports extension by user code.
> I propose deprecating these two methods and replacing them with these four, 
> once the Table interface is merged:
> {code}
> protected Table getTable();
> protected void setTable(Table table);
> protected RegionLocator getRegionLocator();
> protected void setRegionLocator(RegionLocator regionLocator);
> {code}
> Since users will frequently call {{setTable}} and {{setRegionLocator}} 
> together, it probably also makes sense to add the following convenience 
> method:
> {code}
> protected void setTableAndRegionLocator(Table table, RegionLocator 
> regionLocator);
> {code}



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

Reply via email to