Package org.apache.hadoop.hbase.wal
Class RegionGroupingProvider
java.lang.Object
org.apache.hadoop.hbase.wal.AbstractWALProvider
org.apache.hadoop.hbase.wal.RegionGroupingProvider
- All Implemented Interfaces:
PeerActionListener
,WALProvider
A WAL Provider that returns a WAL per group of regions. This provider follows the decorator
pattern and mainly holds the logic for WAL grouping. WAL creation/roll/close is delegated to
DELEGATE_PROVIDER
Region grouping is handled via RegionGroupingProvider.RegionGroupingStrategy
and can
be configured via the property "hbase.wal.regiongrouping.strategy". Current strategy choices are
- defaultStrategy : Whatever strategy this version of HBase picks. currently "bounded".
- identity : each region belongs to its own group.
- bounded : bounded number of groups and region evenly assigned to each group.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
static interface
Map identifiers to a group number.(package private) static enum
Maps between configuration names for strategies and implementation classes.Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.wal.WALProvider
WALProvider.AsyncWriter, WALProvider.Writer, WALProvider.WriterBase
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ConcurrentMap<String,
WALProvider> A group-provider mapping, make sure one-one rather than many-one mappingstatic final String
static final String
static final String
delegate provider for WAL creation/roll/close, but not support multiwalprivate static final org.slf4j.Logger
private static final String
private Class<? extends WALProvider>
static final String
Fields inherited from class org.apache.hadoop.hbase.wal.AbstractWALProvider
abortable, conf, factory, initialized, listeners, logPrefix, providerId, WAL_FILE_NAME_DELIMITER
Fields inherited from interface org.apache.hadoop.hbase.replication.regionserver.PeerActionListener
DUMMY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
close0()
private WALProvider
createProvider
(String group) protected WAL
createRemoteWAL
(RegionInfo region, org.apache.hadoop.fs.FileSystem remoteFs, org.apache.hadoop.fs.Path remoteWALDir, String prefix, String suffix) protected void
doInit
(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId) protected long
protected long
(package private) RegionGroupingProvider.RegionGroupingStrategy
getStrategy
(org.apache.hadoop.conf.Configuration conf, String key, String defaultValue) instantiate a strategy from a config property.private WAL
protected WAL
getWAL0
(RegionInfo region) private WALProvider
getWALProvider
(RegionInfo region) getWALs0()
protected void
Methods inherited from class org.apache.hadoop.hbase.wal.AbstractWALProvider
addWALActionsListener, close, getLogFileSize, getNumLogFiles, getPeerActionListener, getSyncReplicationPeerIdFromWALName, getWAL, getWALs, init, initWAL, peerSyncReplicationStateChange, setSyncReplicationPeerInfoProvider, shutdown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.wal.WALProvider
getWALFileLengthProvider
-
Field Details
-
LOG
-
REGION_GROUPING_STRATEGY
- See Also:
-
DEFAULT_REGION_GROUPING_STRATEGY
-
DELEGATE_PROVIDER
delegate provider for WAL creation/roll/close, but not support multiwal- See Also:
-
DEFAULT_DELEGATE_PROVIDER
-
META_WAL_GROUP_NAME
- See Also:
-
cached
A group-provider mapping, make sure one-one rather than many-one mapping -
createLock
-
strategy
-
providerClass
-
-
Constructor Details
-
RegionGroupingProvider
public RegionGroupingProvider()
-
-
Method Details
-
getStrategy
RegionGroupingProvider.RegionGroupingStrategy getStrategy(org.apache.hadoop.conf.Configuration conf, String key, String defaultValue) throws IOException instantiate a strategy from a config property. requires conf to have already been set (as well as anything the provider might need to read).- Throws:
IOException
-
doInit
protected void doInit(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId) throws IOException - Specified by:
doInit
in classAbstractWALProvider
- Throws:
IOException
-
createProvider
- Throws:
IOException
-
getWALProvider
- Throws:
IOException
-
getWAL0
- Specified by:
getWAL0
in classAbstractWALProvider
- Throws:
IOException
-
getWALs0
- Specified by:
getWALs0
in classAbstractWALProvider
-
getWAL
- Throws:
IOException
-
createRemoteWAL
protected WAL createRemoteWAL(RegionInfo region, org.apache.hadoop.fs.FileSystem remoteFs, org.apache.hadoop.fs.Path remoteWALDir, String prefix, String suffix) throws IOException - Specified by:
createRemoteWAL
in classAbstractWALProvider
- Throws:
IOException
-
shutdown0
- Specified by:
shutdown0
in classAbstractWALProvider
- Throws:
IOException
-
close0
- Specified by:
close0
in classAbstractWALProvider
- Throws:
IOException
-
getNumLogFiles0
- Specified by:
getNumLogFiles0
in classAbstractWALProvider
-
getLogFileSize0
- Specified by:
getLogFileSize0
in classAbstractWALProvider
-