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

Himanshu Vashishtha commented on HBASE-10378:
---------------------------------------------

Yes, hiding the impl specific details from HRS is one big point of this 
feature. Looks like we both are on same page re getWAL() api? That is, hiding 
the details in the impl.

Re: rollWriter()
bq. ... called from admin. Currently it returns set of regions that were 
flushed on calling rollWriter.
No, it doesn't flush any region. It just returns regions which the caller 
should flush in order to archive the oldest WAL file. Actually, this return 
value is never used by the shell. 
Anyway, though rolling is an internal stuff, we have exposed it as an API in 
shell. I would again go the same route and let WAL impl decide how to deal with 
it. For example, TableGroupWALImpl could roll the logs for all tables. Since it 
requires user's input, we can also overload the API as per WAL requirement?
As mentioned in the parent jira, I will take a stab at it once basic switching 
is done.

> Divide HLog interface into User and Implementor specific interfaces
> -------------------------------------------------------------------
>
>                 Key: HBASE-10378
>                 URL: https://issues.apache.org/jira/browse/HBASE-10378
>             Project: HBase
>          Issue Type: Sub-task
>          Components: wal
>            Reporter: Himanshu Vashishtha
>         Attachments: 10378-1.patch
>
>
> HBASE-5937 introduces the HLog interface as a first step to support multiple 
> WAL implementations. This interface is a good start, but has some 
> limitations/drawbacks in its current state, such as:
> 1) There is no clear distinction b/w User and Implementor APIs, and it 
> provides APIs both for WAL users (append, sync, etc) and also WAL 
> implementors (Reader/Writer interfaces, etc). There are APIs which are very 
> much implementation specific (getFileNum, etc) and a user such as a 
> RegionServer shouldn't know about it.
> 2) There are about 14 methods in FSHLog which are not present in HLog 
> interface but are used at several places in the unit test code. These tests 
> typecast HLog to FSHLog, which makes it very difficult to test multiple WAL 
> implementations without doing some ugly checks.
> I'd like to propose some changes in HLog interface that would ease the multi 
> WAL story:
> 1) Have two interfaces WAL and WALService. WAL provides APIs for 
> implementors. WALService provides APIs for users (such as RegionServer).
> 2) A skeleton implementation of the above two interface as the base class for 
> other WAL implementations (AbstractWAL). It provides required fields for all 
> subclasses (fs, conf, log dir, etc). Make a minimal set of test only methods 
> and add this set in AbstractWAL.
> 3) HLogFactory returns a WALService reference when creating a WAL instance; 
> if a user need to access impl specific APIs (there are unit tests which get 
> WAL from a HRegionServer and then call impl specific APIs), use AbstractWAL 
> type casting,
> 4) Make TestHLog abstract and let all implementors provide their respective 
> test class which extends TestHLog (TestFSHLog, for example).



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to