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
Nested ClassesModifier and TypeClassDescription(package private) static classstatic interfaceMap identifiers to a group number.(package private) static enumMaps 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
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap<String,WALProvider> A group-provider mapping, make sure one-one rather than many-one mappingstatic final Stringstatic final Stringstatic final Stringdelegate provider for WAL creation/roll/close, but not support multiwalprivate static final org.slf4j.Loggerprivate static final Stringprivate Class<? extends WALProvider>static final StringFields inherited from class org.apache.hadoop.hbase.wal.AbstractWALProvider
abortable, conf, factory, initialized, listeners, logPrefix, providerId, WAL_FILE_NAME_DELIMITERFields inherited from interface org.apache.hadoop.hbase.replication.regionserver.PeerActionListener
DUMMY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose0()private WALProvidercreateProvider(String group) protected WALcreateRemoteWAL(RegionInfo region, org.apache.hadoop.fs.FileSystem remoteFs, org.apache.hadoop.fs.Path remoteWALDir, String prefix, String suffix) protected voiddoInit(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId) protected longprotected long(package private) RegionGroupingProvider.RegionGroupingStrategygetStrategy(org.apache.hadoop.conf.Configuration conf, String key, String defaultValue) instantiate a strategy from a config property.private WALprotected WALgetWAL0(RegionInfo region) private WALProvidergetWALProvider(RegionInfo region) getWALs0()protected voidMethods inherited from class org.apache.hadoop.hbase.wal.AbstractWALProvider
addWALActionsListener, close, getLogFileSize, getNumLogFiles, getPeerActionListener, getSyncReplicationPeerIdFromWALName, getWAL, getWALs, init, initWAL, peerSyncReplicationStateChange, setSyncReplicationPeerInfoProvider, shutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
doInitin classAbstractWALProvider- Throws:
IOException
-
createProvider
- Throws:
IOException
-
getWALProvider
- Throws:
IOException
-
getWAL0
- Specified by:
getWAL0in classAbstractWALProvider- Throws:
IOException
-
getWALs0
- Specified by:
getWALs0in 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:
createRemoteWALin classAbstractWALProvider- Throws:
IOException
-
shutdown0
- Specified by:
shutdown0in classAbstractWALProvider- Throws:
IOException
-
close0
- Specified by:
close0in classAbstractWALProvider- Throws:
IOException
-
getNumLogFiles0
- Specified by:
getNumLogFiles0in classAbstractWALProvider
-
getLogFileSize0
- Specified by:
getLogFileSize0in classAbstractWALProvider
-