@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_PROVIDER |
Constructor and Description |
---|
WALFactory(org.apache.hadoop.conf.Configuration conf,
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.
|
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.
|
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) |
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_PROVIDER
public static final String META_WAL_PROVIDER
public WALFactory(org.apache.hadoop.conf.Configuration conf, String factoryId) throws IOException
conf
- must not be null, will keep a reference to read params in later reader/writer
instances.factoryId
- a unique identifier for this factory. used i.e. by filesystem implementations
to make a directoryIOException
public Class<? extends WALProvider> getProviderClass(String key, String defaultValue)
public void close() throws IOException
IOException
public void shutdown() throws IOException
IOException
public WAL getWAL(RegionInfo region) throws IOException
region
- the region which we want to get a WAL for it. Could be null.IOException
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
Should be package-private. public only for tests and
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
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
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
public final WALProvider getWALProvider()
public final WALProvider getMetaWALProvider()
Copyright © 2007–2019 Cloudera. All rights reserved.