Class DisabledWALProvider.DisabledWAL

java.lang.Object
org.apache.hadoop.hbase.wal.DisabledWALProvider.DisabledWAL
All Implemented Interfaces:
Closeable, AutoCloseable, WALFileLengthProvider, WAL
Enclosing class:
DisabledWALProvider

private static class DisabledWALProvider.DisabledWAL extends Object implements WAL
  • Field Details

  • Constructor Details

  • Method Details

    • registerWALActionsListener

      Description copied from interface: WAL
      Registers WALActionsListener
      Specified by:
      registerWALActionsListener in interface WAL
    • unregisterWALActionsListener

      Description copied from interface: WAL
      Unregisters WALActionsListener
      Specified by:
      unregisterWALActionsListener in interface WAL
    • rollWriter

      public Map<byte[],List<byte[]>> rollWriter()
      Description copied from interface: WAL
      Roll the log writer. That is, start writing log messages to a new file.

      The implementation is synchronized in order to make sure there's one rollWriter running at any given time.

      Specified by:
      rollWriter in interface WAL
      Returns:
      If lots of logs, flush the stores of returned regions so next time through we can clean logs. Returns null if nothing to flush. Names are actual region names as returned by RegionInfo.getEncodedName()
    • rollWriter

      public Map<byte[],List<byte[]>> rollWriter(boolean force)
      Description copied from interface: WAL
      Roll the log writer. That is, start writing log messages to a new file.

      The implementation is synchronized in order to make sure there's one rollWriter running at any given time. If true, force creation of a new writer even if no entries have been written to the current writer

      Specified by:
      rollWriter in interface WAL
      Returns:
      If lots of logs, flush the stores of returned regions so next time through we can clean logs. Returns null if nothing to flush. Names are actual region names as returned by RegionInfo.getEncodedName()
    • shutdown

      public void shutdown()
      Description copied from interface: WAL
      Stop accepting new writes. If we have unsynced writes still in buffer, sync them. Extant edits are left in place in backing storage to be replayed later.
      Specified by:
      shutdown in interface WAL
    • close

      public void close()
      Description copied from interface: WAL
      Caller no longer needs any edits from this WAL. Implementers are free to reclaim underlying resources after this call; i.e. filesystem based WALs can archive or delete files.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface WAL
    • appendData

      public long appendData(RegionInfo info, WALKeyImpl key, WALEdit edits) throws IOException
      Description copied from interface: WAL
      Append a set of data edits to the WAL. 'Data' here means that the content in the edits will also have transitioned through the memstore.

      The WAL is not flushed/sync'd after this transaction completes BUT on return this edit must have its region edit/sequence id assigned else it messes up our unification of mvcc and sequenceid. On return key will have the region edit/sequence id filled in.

      Specified by:
      appendData in interface WAL
      Parameters:
      info - the regioninfo associated with append
      key - Modified by this call; we add to it this edits region edit/sequence id.
      edits - Edits to append. MAY CONTAIN NO EDITS for case where we want to get an edit sequence id that is after all currently appended edits.
      Returns:
      Returns a 'transaction id' and key will have the region edit/sequence id in it.
      Throws:
      IOException
      See Also:
    • appendMarker

      public long appendMarker(RegionInfo info, WALKeyImpl key, WALEdit edits) throws IOException
      Description copied from interface: WAL
      Append an operational 'meta' event marker edit to the WAL. A marker meta edit could be a FlushDescriptor, a compaction marker, or a region event marker; e.g. region open or region close. The difference between a 'marker' append and a 'data' append as in WAL.appendData(RegionInfo, WALKeyImpl, WALEdit)is that a marker will not have transitioned through the memstore.

      The WAL is not flushed/sync'd after this transaction completes BUT on return this edit must have its region edit/sequence id assigned else it messes up our unification of mvcc and sequenceid. On return key will have the region edit/sequence id filled in.

      Specified by:
      appendMarker in interface WAL
      Parameters:
      info - the regioninfo associated with append
      key - Modified by this call; we add to it this edits region edit/sequence id.
      edits - Edits to append. MAY CONTAIN NO EDITS for case where we want to get an edit sequence id that is after all currently appended edits.
      Returns:
      Returns a 'transaction id' and key will have the region edit/sequence id in it.
      Throws:
      IOException
      See Also:
    • append

      private long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException
      Throws:
      IOException
    • updateStore

      public void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceid, boolean onlyIfGreater)
      Description copied from interface: WAL
      updates the seuence number of a specific store. depending on the flag: replaces current seq number if the given seq id is bigger, or even if it is lower than existing one
      Specified by:
      updateStore in interface WAL
    • sync

      public void sync()
      Description copied from interface: WAL
      Sync what we have in the WAL.
      Specified by:
      sync in interface WAL
    • sync

      public void sync(long txid)
      Description copied from interface: WAL
      Sync the WAL if the txId was not already sync'd.
      Specified by:
      sync in interface WAL
      Parameters:
      txid - Transaction id to sync to.
    • startCacheFlush

      public Long startCacheFlush(byte[] encodedRegionName, Map<byte[],Long> flushedFamilyNamesToSeq)
      Specified by:
      startCacheFlush in interface WAL
    • startCacheFlush

      public Long startCacheFlush(byte[] encodedRegionName, Set<byte[]> flushedFamilyNames)
      Description copied from interface: WAL
      WAL keeps track of the sequence numbers that are as yet not flushed im memstores in order to be able to do accounting to figure which WALs can be let go. This method tells WAL that some region is about to flush. The flush can be the whole region or for a column family of the region only.

      Currently, it is expected that the update lock is held for the region; i.e. no concurrent appends while we set up cache flush.

      Specified by:
      startCacheFlush in interface WAL
      flushedFamilyNames - Families to flush. May be a subset of all families in the region.
      Returns:
      Returns HConstants.NO_SEQNUM if we are flushing the whole region OR if we are flushing a subset of all families but there are no edits in those families not being flushed; in other words, this is effectively same as a flush of all of the region though we were passed a subset of regions. Otherwise, it returns the sequence id of the oldest/lowest outstanding edit.
      See Also:
    • completeCacheFlush

      public void completeCacheFlush(byte[] encodedRegionName, long maxFlushedSeqId)
      Description copied from interface: WAL
      Complete the cache flush.
      Specified by:
      completeCacheFlush in interface WAL
      Parameters:
      encodedRegionName - Encoded region name.
      maxFlushedSeqId - The maxFlushedSeqId for this flush. There is no edit in memory that is less that this sequence id.
      See Also:
    • abortCacheFlush

      public void abortCacheFlush(byte[] encodedRegionName)
      Description copied from interface: WAL
      Abort a cache flush. Call if the flush fails. Note that the only recovery for an aborted flush currently is a restart of the regionserver so the snapshot content dropped by the failure gets restored to the memstore.
      Specified by:
      abortCacheFlush in interface WAL
      Parameters:
      encodedRegionName - Encoded region name.
    • getCoprocessorHost

      Description copied from interface: WAL
      Returns Coprocessor host.
      Specified by:
      getCoprocessorHost in interface WAL
    • getEarliestMemStoreSeqNum

      public long getEarliestMemStoreSeqNum(byte[] encodedRegionName)
      Description copied from interface: WAL
      Gets the earliest unflushed sequence id in the memstore for the region.
      Specified by:
      getEarliestMemStoreSeqNum in interface WAL
      Parameters:
      encodedRegionName - The region to get the number for.
      Returns:
      The earliest/lowest/oldest sequence id if present, HConstants.NO_SEQNUM if absent.
    • getEarliestMemStoreSeqNum

      public long getEarliestMemStoreSeqNum(byte[] encodedRegionName, byte[] familyName)
      Description copied from interface: WAL
      Gets the earliest unflushed sequence id in the memstore for the store.
      Specified by:
      getEarliestMemStoreSeqNum in interface WAL
      Parameters:
      encodedRegionName - The region to get the number for.
      familyName - The family to get the number for.
      Returns:
      The earliest/lowest/oldest sequence id if present, HConstants.NO_SEQNUM if absent.
    • toString

      public String toString()
      Description copied from interface: WAL
      Human readable identifying information about the state of this WAL. Implementors are encouraged to include information appropriate for debugging. Consumers are advised not to rely on the details of the returned String; it does not have a defined structure.
      Specified by:
      toString in interface WAL
      Overrides:
      toString in class Object
    • getLogFileSizeIfBeingWritten

      public OptionalLong getLogFileSizeIfBeingWritten(org.apache.hadoop.fs.Path path)
      Specified by:
      getLogFileSizeIfBeingWritten in interface WALFileLengthProvider