Interface StoreFlushContext

All Known Implementing Classes:
HStore.StoreFlusherImpl

@Private interface StoreFlushContext
A package protected interface for a store flushing. A store flush context carries the state required to prepare/flush/commit the store's cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abort the snapshot preparation.
    boolean
    Commit the flush - add the store file to the store and clear the memstore snapshot.
    void
    Flush the cache (create the new store file) A length operation which doesn't require locking out any function of the store.
    List<org.apache.hadoop.fs.Path>
    Returns the newly committed files from the flush.
    long
    Returns the total file size for flush output files, in bytes
    Prepare for a store flush (create snapshot) Requires pausing writes.
    void
    replayFlush(List<String> fileNames, boolean dropMemstoreSnapshot)
    Similar to commit, but called in secondary region replicas for replaying the flush cache from primary region.
  • Method Details

    • prepare

      Prepare for a store flush (create snapshot) Requires pausing writes. A very short operation.
      Returns:
      The size of snapshot to flush
    • flushCache

      void flushCache(MonitoredTask status) throws IOException
      Flush the cache (create the new store file) A length operation which doesn't require locking out any function of the store.
      Throws:
      IOException - in case the flush fails
    • commit

      boolean commit(MonitoredTask status) throws IOException
      Commit the flush - add the store file to the store and clear the memstore snapshot. Requires pausing scans. A very short operation
      Returns:
      whether compaction is required
      Throws:
      IOException
    • replayFlush

      void replayFlush(List<String> fileNames, boolean dropMemstoreSnapshot) throws IOException
      Similar to commit, but called in secondary region replicas for replaying the flush cache from primary region. Adds the new files to the store, and drops the snapshot depending on dropMemstoreSnapshot argument.
      Parameters:
      fileNames - names of the flushed files
      dropMemstoreSnapshot - whether to drop the prepared memstore snapshot
      Throws:
      IOException
    • abort

      void abort() throws IOException
      Abort the snapshot preparation. Drops the snapshot if any.
      Throws:
      IOException
    • getCommittedFiles

      List<org.apache.hadoop.fs.Path> getCommittedFiles()
      Returns the newly committed files from the flush. Called only if commit returns true
      Returns:
      a list of Paths for new files
    • getOutputFileSize

      Returns the total file size for flush output files, in bytes