Package org.apache.hadoop.hbase.wal
Class IOTestProvider
java.lang.Object
org.apache.hadoop.hbase.wal.IOTestProvider
- All Implemented Interfaces:
org.apache.hadoop.hbase.wal.WALProvider
@Private
public class IOTestProvider
extends Object
implements org.apache.hadoop.hbase.wal.WALProvider
A WAL Provider that returns a single thread safe WAL that optionally can skip parts of our normal
interactions with HDFS.
This implementation picks a directory in HDFS based on the same mechanisms as the
FSHLogProvider. Users can configure how much interaction we have with HDFS with the
configuration property "hbase.wal.iotestprovider.operations". The value should be a comma
separated list of allowed operations:
- append : edits will be written to the underlying filesystem
- sync : wal syncs will result in hflush calls
- fileroll : roll requests will result in creating a new file on the underlying filesystem.
Only those operations listed will occur between the returned WAL and HDFS. All others will be no-ops.
Note that in the case of allowing "append" operations but not allowing "fileroll", the returned WAL will just keep writing to the same file. This won't avoid all costs associated with file management over time, becaue the data set size may result in additional HDFS block allocations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enumprivate static classprivate static classPresumes init will be called by a single thread prior to any access of other methods.Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.wal.WALProvider
org.apache.hadoop.hbase.wal.WALProvider.AsyncWriter, org.apache.hadoop.hbase.wal.WALProvider.Writer, org.apache.hadoop.hbase.wal.WALProvider.WriterBase -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate org.apache.hadoop.conf.Configurationprivate org.apache.hadoop.hbase.wal.WALFactoryprotected AtomicBooleanprivate List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener>private org.apache.hadoop.hbase.regionserver.wal.FSHLogprivate static final org.slf4j.Loggerprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWALActionsListener(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener) voidclose()private org.apache.hadoop.hbase.regionserver.wal.FSHLoglonglongorg.apache.hadoop.hbase.wal.WALgetWAL(org.apache.hadoop.hbase.client.RegionInfo region) List<org.apache.hadoop.hbase.wal.WAL>getWALs()voidinit(org.apache.hadoop.hbase.wal.WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, org.apache.hadoop.hbase.Abortable abortable) voidshutdown()Methods 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
-
ALLOWED_OPERATIONS
- See Also:
-
factory
-
conf
-
log
-
providerId
-
initialized
-
listeners
-
-
Constructor Details
-
IOTestProvider
public IOTestProvider()
-
-
Method Details
-
init
public void init(org.apache.hadoop.hbase.wal.WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, org.apache.hadoop.hbase.Abortable abortable) throws IOException - Specified by:
initin interfaceorg.apache.hadoop.hbase.wal.WALProvider- Parameters:
factory- factory that made us, identity used for FS layout. may not be nullconf- may not be nullproviderId- differentiate between providers from one facotry, used for FS layout. may be null- Throws:
IOException
-
getWALs
- Specified by:
getWALsin interfaceorg.apache.hadoop.hbase.wal.WALProvider
-
createWAL
- Throws:
IOException
-
getWAL
public org.apache.hadoop.hbase.wal.WAL getWAL(org.apache.hadoop.hbase.client.RegionInfo region) throws IOException - Specified by:
getWALin interfaceorg.apache.hadoop.hbase.wal.WALProvider- Throws:
IOException
-
close
- Specified by:
closein interfaceorg.apache.hadoop.hbase.wal.WALProvider- Throws:
IOException
-
shutdown
- Specified by:
shutdownin interfaceorg.apache.hadoop.hbase.wal.WALProvider- Throws:
IOException
-
getNumLogFiles
- Specified by:
getNumLogFilesin interfaceorg.apache.hadoop.hbase.wal.WALProvider
-
getLogFileSize
- Specified by:
getLogFileSizein interfaceorg.apache.hadoop.hbase.wal.WALProvider
-
addWALActionsListener
public void addWALActionsListener(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener) - Specified by:
addWALActionsListenerin interfaceorg.apache.hadoop.hbase.wal.WALProvider
-