Details
Description
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).
Attachments
Attachments
Issue Links
- breaks
-
HBASE-12532 TestFilter failing occasionally with ExitCodeException doing chmod since HBASE-10378
- Closed
- is depended upon by
-
HBASE-12437 HLogFactory should be able to accept multiple custom WALReaders in case of failure to read WAL logs due to upgrade/migrate of hbase
- Closed
-
HBASE-5699 Run with > 1 WAL in HRegionServer
- Closed
-
HBASE-12522 Backport WAL refactoring to branch-1
- Closed
- is duplicated by
-
HBASE-6935 Rename HLog interface to WAL
- Closed
- supercedes
-
HBASE-8610 Introduce interfaces to support MultiWAL
- Closed
- links to