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
Modifier and TypeClassDescriptionprivate static enum
private static class
private static class
Presumes 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
Modifier and TypeFieldDescriptionprivate static final String
private org.apache.hadoop.conf.Configuration
private org.apache.hadoop.hbase.wal.WALFactory
protected AtomicBoolean
private List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener>
private org.apache.hadoop.hbase.regionserver.wal.FSHLog
private static final org.slf4j.Logger
private String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWALActionsListener
(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener) void
close()
private org.apache.hadoop.hbase.regionserver.wal.FSHLog
long
long
org.apache.hadoop.hbase.wal.WAL
getWAL
(org.apache.hadoop.hbase.client.RegionInfo region) List<org.apache.hadoop.hbase.wal.WAL>
getWALs()
void
init
(org.apache.hadoop.hbase.wal.WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, org.apache.hadoop.hbase.Abortable abortable) void
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
-
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:
init
in 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:
getWALs
in 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:
getWAL
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
- Throws:
IOException
-
close
- Specified by:
close
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
- Throws:
IOException
-
shutdown
- Specified by:
shutdown
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
- Throws:
IOException
-
getNumLogFiles
- Specified by:
getNumLogFiles
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
-
getLogFileSize
- Specified by:
getLogFileSize
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
-
addWALActionsListener
public void addWALActionsListener(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener) - Specified by:
addWALActionsListener
in interfaceorg.apache.hadoop.hbase.wal.WALProvider
-