@InterfaceAudience.Private public class WALFactory extends Object
WALProvider
by class name.Modifier and Type | Class and Description |
---|---|
(package private) static class |
WALFactory.Providers
Maps between configuration names for providers and implementation classes.
|
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
(package private) static String |
DEFAULT_META_WAL_PROVIDER |
(package private) static String |
DEFAULT_WAL_PROVIDER |
(package private) String |
factoryId |
private static org.apache.commons.logging.Log |
LOG |
private Class<? extends DefaultWALProvider.Reader> |
logReaderClass
Configuration-specified WAL Reader used when a custom reader is requested
|
(package private) static String |
META_WAL_PROVIDER |
(package private) AtomicReference<WALProvider> |
metaProvider |
(package private) WALProvider |
provider |
private static AtomicReference<WALFactory> |
singleton |
private static String |
SINGLETON_ID |
private int |
timeoutMillis
How long to attempt opening in-recovery wals
|
static String |
WAL_PROVIDER |
Modifier | Constructor and Description |
---|---|
private |
WALFactory(org.apache.hadoop.conf.Configuration conf) |
|
WALFactory(org.apache.hadoop.conf.Configuration conf,
List<WALActionsListener> listeners,
String factoryId) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown all WALs and clean up any underlying storage.
|
WAL.Reader |
createReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
WAL.Reader |
createReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CancelableProgressable reporter)
Create a reader for the WAL.
|
WAL.Reader |
createReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CancelableProgressable reporter,
boolean allowCustom) |
static WAL.Reader |
createReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration configuration)
Create a reader for the given path, accept custom reader classes from conf.
|
(package private) static WAL.Reader |
createReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration configuration,
CancelableProgressable reporter)
Create a reader for the given path, accept custom reader classes from conf.
|
static WAL.Reader |
createReaderIgnoreCustomClass(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration configuration)
Create a reader for the given path, ignore custom reader classes from conf.
|
WALProvider.Writer |
createRecoveredEditsWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
should be package-private, visible for recovery testing.
|
(package private) static WALProvider.Writer |
createRecoveredEditsWriter(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.
|
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.
|
static WALFactory |
getInstance(org.apache.hadoop.conf.Configuration configuration) |
WAL |
getMetaWAL(byte[] identifier) |
(package private) WALProvider |
getProvider(String key,
String defaultValue,
List<WALActionsListener> listeners,
String providerId)
instantiate a provider from a config property.
|
WAL |
getWAL(byte[] identifier) |
void |
shutdown()
Tell the underlying WAL providers to shut down, but do not clean up underlying storage.
|
private static final org.apache.commons.logging.Log LOG
public static final String WAL_PROVIDER
static final String DEFAULT_WAL_PROVIDER
static final String META_WAL_PROVIDER
static final String DEFAULT_META_WAL_PROVIDER
final String factoryId
final WALProvider provider
final AtomicReference<WALProvider> metaProvider
private final Class<? extends DefaultWALProvider.Reader> logReaderClass
private final int timeoutMillis
private final org.apache.hadoop.conf.Configuration conf
private static final AtomicReference<WALFactory> singleton
private static final String SINGLETON_ID
private WALFactory(org.apache.hadoop.conf.Configuration conf)
public WALFactory(org.apache.hadoop.conf.Configuration conf, List<WALActionsListener> listeners, String factoryId) throws IOException
conf
- must not be null, will keep a reference to read params in later reader/writer
instances.listeners
- may be null. will be given to all created wals (and not meta-wals)factoryId
- a unique identifier for this factory. used i.e. by filesystem implementations
to make a directoryIOException
WALProvider getProvider(String key, String defaultValue, List<WALActionsListener> listeners, String providerId) throws IOException
IOException
public void close() throws IOException
IOException
public void shutdown() throws IOException
IOException
public WAL getWAL(byte[] identifier) throws IOException
identifier
- may not be null, contents will not be alteredIOException
public WAL getMetaWAL(byte[] identifier) throws IOException
identifier
- may not be null, contents will not be alteredIOException
public WAL.Reader createReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOException
public WAL.Reader createReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CancelableProgressable reporter) throws IOException
WAL.Reader.reset()
instead of this method
then just seek back to the last known good position.IOException
public WAL.Reader createReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CancelableProgressable reporter, boolean allowCustom) throws IOException
IOException
public WALProvider.Writer createWALWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
Compressor
IOException
public WALProvider.Writer createRecoveredEditsWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOException
public static WALFactory getInstance(org.apache.hadoop.conf.Configuration configuration)
public static WAL.Reader createReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration) throws IOException
IOException
static WAL.Reader createReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration, CancelableProgressable reporter) throws IOException
IOException
public static WAL.Reader createReaderIgnoreCustomClass(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration) throws IOException
Compressor
IOException
static WALProvider.Writer createRecoveredEditsWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration) throws IOException
IOException
public static WALProvider.Writer createWALWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration configuration) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.