@InterfaceAudience.Private public interface WALProvider
See FSHLogProvider
for an example implementation. A single WALProvider will be used for
retrieving multiple WALs in a particular region server and must be threadsafe.
Modifier and Type | Interface and Description |
---|---|
static interface |
WALProvider.AsyncWriter |
static interface |
WALProvider.Writer |
static interface |
WALProvider.WriterBase |
Modifier and Type | Method and Description |
---|---|
void |
addWALActionsListener(WALActionsListener listener)
Add a
WALActionsListener . |
void |
close()
shutdown utstanding WALs and clean up any persisted state.
|
long |
getLogFileSize()
Get size of the log files this provider is managing
|
long |
getNumLogFiles()
Get number of the log files this provider is managing
|
WAL |
getWAL(RegionInfo region) |
default WALFileLengthProvider |
getWALFileLengthProvider() |
List<WAL> |
getWALs() |
void |
init(WALFactory factory,
org.apache.hadoop.conf.Configuration conf,
String providerId)
Set up the provider to create wals.
|
void |
shutdown()
persist outstanding WALs to storage and stop accepting new appends.
|
void init(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId) throws IOException
factory
- factory that made us may not be nullconf
- may not be nullproviderId
- differentiate between providers from one factory. may be nullIOException
WAL getWAL(RegionInfo region) throws IOException
region
- the region which we want to get a WAL for it. Could be null.IOException
void shutdown() throws IOException
IOException
void close() throws IOException
IOException
long getNumLogFiles()
long getLogFileSize()
void addWALActionsListener(WALActionsListener listener)
WALActionsListener
.
Notice that you must call this method before calling getWAL(RegionInfo)
as this method
will not effect the WAL
which has already been created. And as long as we can only it
when initialization, it is not thread safe.
default WALFileLengthProvider getWALFileLengthProvider()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.