@InterfaceAudience.Private public class IOTestProvider extends Object implements org.apache.hadoop.hbase.wal.WALProvider
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:
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.
Modifier and Type | Class and Description |
---|---|
private static class |
IOTestProvider.AllowedOperations |
private static class |
IOTestProvider.IOTestWAL |
private static class |
IOTestProvider.IOTestWriter
Presumes init will be called by a single thread prior to any access of other methods.
|
Modifier and Type | Field and Description |
---|---|
private static String |
ALLOWED_OPERATIONS |
private org.apache.hadoop.conf.Configuration |
conf |
private org.apache.hadoop.hbase.wal.WALFactory |
factory |
private List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener> |
listeners |
private org.apache.hadoop.hbase.regionserver.wal.FSHLog |
log |
private static org.slf4j.Logger |
LOG |
private String |
providerId |
Constructor and Description |
---|
IOTestProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addWALActionsListener(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener) |
void |
close() |
private org.apache.hadoop.hbase.regionserver.wal.FSHLog |
createWAL() |
long |
getLogFileSize() |
long |
getNumLogFiles() |
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) |
void |
shutdown() |
private static final org.slf4j.Logger LOG
private static final String ALLOWED_OPERATIONS
private org.apache.hadoop.hbase.wal.WALFactory factory
private org.apache.hadoop.conf.Configuration conf
private volatile org.apache.hadoop.hbase.regionserver.wal.FSHLog log
private String providerId
public IOTestProvider()
public void init(org.apache.hadoop.hbase.wal.WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId) throws IOException
init
in interface org.apache.hadoop.hbase.wal.WALProvider
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
nullIOException
public List<org.apache.hadoop.hbase.wal.WAL> getWALs()
getWALs
in interface org.apache.hadoop.hbase.wal.WALProvider
private org.apache.hadoop.hbase.regionserver.wal.FSHLog createWAL() throws IOException
IOException
public org.apache.hadoop.hbase.wal.WAL getWAL(org.apache.hadoop.hbase.client.RegionInfo region) throws IOException
getWAL
in interface org.apache.hadoop.hbase.wal.WALProvider
IOException
public void close() throws IOException
close
in interface org.apache.hadoop.hbase.wal.WALProvider
IOException
public void shutdown() throws IOException
shutdown
in interface org.apache.hadoop.hbase.wal.WALProvider
IOException
public long getNumLogFiles()
getNumLogFiles
in interface org.apache.hadoop.hbase.wal.WALProvider
public long getLogFileSize()
getLogFileSize
in interface org.apache.hadoop.hbase.wal.WALProvider
public void addWALActionsListener(org.apache.hadoop.hbase.regionserver.wal.WALActionsListener listener)
addWALActionsListener
in interface org.apache.hadoop.hbase.wal.WALProvider
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.