Package org.apache.hadoop.hbase.wal
Interface WALProvider
- All Known Implementing Classes:
AbstractFSWALProvider,AbstractWALProvider,AsyncFSWALProvider,DisabledWALProvider,FSHLogProvider,RegionGroupingProvider
The Write Ahead Log (WAL) stores all durable edits to the HRegion. This interface provides the
entry point for all WAL implementors.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWALActionsListener(WALActionsListener listener) Add aWALActionsListener.voidclose()shutdown utstanding WALs and clean up any persisted state.longGet size of the log files this provider is managinglongGet number of the log files this provider is managingdefault PeerActionListenergetWAL(RegionInfo region) default WALFileLengthProvidergetWALs()Returns the List of WALs that are used by this servervoidinit(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, Abortable server) Set up the provider to create wals.default voidvoidshutdown()persist outstanding WALs to storage and stop accepting new appends.
-
Method Details
-
init
void init(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, Abortable server) throws IOException Set up the provider to create wals. will only be called once per instance.- Parameters:
factory- factory that made us may not be nullconf- may not be nullproviderId- differentiate between providers from one factory. may be null- Throws:
IOException
-
getWAL
- Parameters:
region- the region which we want to get a WAL for it. Could be null.- Returns:
- a WAL for writing entries for the given region.
- Throws:
IOException
-
getWALs
Returns the List of WALs that are used by this server -
shutdown
persist outstanding WALs to storage and stop accepting new appends. This method serves as shorthand for sending a sync to every WAL provided by a given implementation. Those WALs will also stop accepting new writes.- Throws:
IOException
-
close
shutdown utstanding WALs and clean up any persisted state. Call this method only when you will not need to replay any of the edits to the WALs from this provider. After this call completes, the underlying resources should have been reclaimed.- Throws:
IOException
-
getNumLogFiles
long getNumLogFiles()Get number of the log files this provider is managing -
getLogFileSize
long getLogFileSize()Get size of the log files this provider is managing -
addWALActionsListener
Add aWALActionsListener.Notice that you must call this method before calling
getWAL(RegionInfo)as this method will not effect theWALwhich has already been created. And as long as we can only it when initialization, it is not thread safe. -
getWALFileLengthProvider
-
getPeerActionListener
-
setSyncReplicationPeerInfoProvider
-