@InterfaceAudience.Private public class WALFactory extends Object
WALProvider by class name.| Modifier and Type | Field and Description |
|---|---|
static String |
META_WAL_PROVIDER |
static String |
WAL_ENABLED |
static String |
WAL_PROVIDER |
static String |
WAL_STREAM_READER_CLASS_IMPL
Used in tests for injecting customized stream reader implementation, for example, inject fault
when reading, etc.
|
| Constructor and Description |
|---|
WALFactory(org.apache.hadoop.conf.Configuration conf,
String factoryId) |
WALFactory(org.apache.hadoop.conf.Configuration conf,
String factoryId,
Abortable abortable) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shutdown all WALs and clean up any underlying storage.
|
WALProvider.Writer |
createRecoveredEditsWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Should be package-private, visible for recovery testing.
|
WALStreamReader |
createStreamReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
WALStreamReader |
createStreamReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CancelableProgressable reporter)
Create a one-way stream reader for the WAL.
|
WALStreamReader |
createStreamReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CancelableProgressable reporter,
long startPosition)
Create a one-way stream reader for the WAL, and start reading from the given
startPosition. |
static WALStreamReader |
createStreamReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Create a one-way stream reader for a given path.
|
static WALStreamReader |
createStreamReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
long startPosition)
Create a one-way stream reader for a given path.
|
static WALTailingReader |
createTailingReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
long startPosition)
Create a tailing reader for the given path.
|
WALProvider.Writer |
createWALWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Create a writer for the WAL.
|
static WALProvider.Writer |
createWALWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration configuration)
If you already have a WALFactory, you should favor the instance method.
|
ExcludeDatanodeManager |
getExcludeDatanodeManager() |
String |
getFactoryId() |
static WALFactory |
getInstance(org.apache.hadoop.conf.Configuration configuration) |
WALProvider |
getMetaProvider()
Called when we lazily create a hbase:meta WAL OR from ReplicationSourceManager ahead of
creating the first hbase:meta WAL so we can register a listener.
|
WALProvider |
getMetaWALProvider() |
Class<? extends WALProvider> |
getProviderClass(String key,
String defaultValue) |
WAL |
getWAL(RegionInfo region) |
WALProvider |
getWALProvider() |
List<WAL> |
getWALs() |
void |
shutdown()
Tell the underlying WAL providers to shut down, but do not clean up underlying storage.
|
public static final String WAL_STREAM_READER_CLASS_IMPL
SecureWALCellCodec to decode by check the
header of the WAL file, so we do not need to specify a specical reader to read the WAL file
either.
So typically you should not use this config in production.public static final String WAL_PROVIDER
public static final String META_WAL_PROVIDER
public static final String WAL_ENABLED
public WALFactory(org.apache.hadoop.conf.Configuration conf,
String factoryId)
throws IOException
IOExceptionpublic WALFactory(org.apache.hadoop.conf.Configuration conf,
String factoryId,
Abortable abortable)
throws IOException
conf - must not be null, will keep a reference to read params in later reader/writer
instances.abortable - the server to abortIOExceptionpublic Class<? extends WALProvider> getProviderClass(String key, String defaultValue)
public void close()
throws IOException
IOExceptionpublic void shutdown()
throws IOException
IOExceptionpublic WALProvider getMetaProvider() throws IOException
IOExceptiongetMetaWALProvider()public WAL getWAL(RegionInfo region) throws IOException
region - the region which we want to get a WAL for. Could be null.IOExceptionpublic WALStreamReader createStreamReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOExceptionpublic WALStreamReader createStreamReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CancelableProgressable reporter) throws IOException
IOExceptionpublic WALStreamReader createStreamReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CancelableProgressable reporter, long startPosition) throws IOException
startPosition.IOExceptionpublic WALProvider.Writer createWALWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
Should be package-private. public only for tests and
Compressor
IOExceptionpublic WALProvider.Writer createRecoveredEditsWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOExceptionpublic static WALFactory getInstance(org.apache.hadoop.conf.Configuration configuration)
public static WALTailingReader createTailingReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, long startPosition) throws IOException
IOExceptionpublic static WALStreamReader createStreamReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionpublic static WALStreamReader createStreamReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, long startPosition) throws IOException
IOExceptionpublic static WALProvider.Writer createWALWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration) throws IOException
IOExceptionpublic String getFactoryId()
public WALProvider getWALProvider()
public WALProvider getMetaWALProvider()
getMetaProvider()public ExcludeDatanodeManager getExcludeDatanodeManager()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.