Class HStore.StoreFlusherImpl
java.lang.Object
org.apache.hadoop.hbase.regionserver.HStore.StoreFlusherImpl
- All Implemented Interfaces:
StoreFlushContext
- Enclosing class:
- HStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final longprivate longprivate List<org.apache.hadoop.fs.Path>private longprivate MemStoreSnapshotprivate List<org.apache.hadoop.fs.Path>private final FlushLifeCycleTrackerprivate final HStore.StoreFileWriterCreationTracker -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStoreFlusherImpl(long cacheFlushSeqNum, FlushLifeCycleTracker tracker) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort the snapshot preparation.booleancommit(MonitoredTask status) Commit the flush - add the store file to the store and clear the memstore snapshot.voidflushCache(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.longReturns the total file size for flush output files, in bytesprepare()This is not thread safe.voidreplayFlush(List<String> fileNames, boolean dropMemstoreSnapshot) Similar to commit, but called in secondary region replicas for replaying the flush cache from primary region.
-
Field Details
-
tracker
-
writerCreationTracker
-
cacheFlushSeqNum
-
snapshot
-
tempFiles
-
committedFiles
-
cacheFlushCount
-
cacheFlushSize
-
outputFileSize
-
-
Constructor Details
-
StoreFlusherImpl
-
-
Method Details
-
prepare
This is not thread safe. The caller should have a lock on the region or the store. If necessary, the lock can be added with the patch provided in HBASE-10087- Specified by:
preparein interfaceStoreFlushContext- Returns:
- The size of snapshot to flush
-
flushCache
Description copied from interface:StoreFlushContextFlush the cache (create the new store file) A length operation which doesn't require locking out any function of the store.- Specified by:
flushCachein interfaceStoreFlushContext- Throws:
IOException- in case the flush fails
-
commit
Description copied from interface:StoreFlushContextCommit the flush - add the store file to the store and clear the memstore snapshot. Requires pausing scans. A very short operation- Specified by:
commitin interfaceStoreFlushContext- Returns:
- whether compaction is required
- Throws:
IOException
-
getOutputFileSize
Description copied from interface:StoreFlushContextReturns the total file size for flush output files, in bytes- Specified by:
getOutputFileSizein interfaceStoreFlushContext
-
getCommittedFiles
Description copied from interface:StoreFlushContextReturns the newly committed files from the flush. Called only if commit returns true- Specified by:
getCommittedFilesin interfaceStoreFlushContext- Returns:
- a list of Paths for new files
-
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.- Specified by:
replayFlushin interfaceStoreFlushContext- 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.- Specified by:
abortin interfaceStoreFlushContext- Throws:
IOException
-