Interface StoreFlushContext
- All Known Implementing Classes:
HStore.StoreFlusherImpl
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 TypeMethodDescriptionvoid
abort()
Abort the snapshot preparation.boolean
commit
(MonitoredTask status) Commit the flush - add the store file to the store and clear the memstore snapshot.void
flushCache
(MonitoredTask status) 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 bytesprepare()
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
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
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
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 filesdropMemstoreSnapshot
- whether to drop the prepared memstore snapshot- Throws:
IOException
-
abort
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
long getOutputFileSize()Returns the total file size for flush output files, in bytes
-