Interface WALProvider

All Known Implementing Classes:
AbstractFSWALProvider, AsyncFSWALProvider, DisabledWALProvider, FSHLogProvider, RegionGroupingProvider

@Private public interface WALProvider
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.

  • Method Details

    • init

      void init(WALFactory factory, org.apache.hadoop.conf.Configuration conf, String providerId, Abortable abortable) 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 null
      conf - may not be null
      providerId - differentiate between providers from one factory. may be null
      Throws:
      IOException
    • getWAL

      WAL getWAL(RegionInfo region) throws IOException
      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

      void shutdown() throws IOException
      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

      void close() throws IOException
      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

      Get number of the log files this provider is managing
    • getLogFileSize

      Get size of the log files this provider is managing
    • addWALActionsListener

      Add a 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.

    • getWALFileLengthProvider