Class HStore.StoreFlusherImpl
java.lang.Object
org.apache.hadoop.hbase.regionserver.HStore.StoreFlusherImpl
- All Implemented Interfaces:
StoreFlushContext
- Enclosing class:
- HStore
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private final long
private long
private List<org.apache.hadoop.fs.Path>
private long
private MemStoreSnapshot
private List<org.apache.hadoop.fs.Path>
private final FlushLifeCycleTracker
private final HStore.StoreFileWriterCreationTracker
-
Constructor Summary
ModifierConstructorDescriptionprivate
StoreFlusherImpl
(long cacheFlushSeqNum, FlushLifeCycleTracker tracker) -
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()
This is not thread safe.void
replayFlush
(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:
prepare
in interfaceStoreFlushContext
- Returns:
- The size of snapshot to flush
-
flushCache
Description copied from interface:StoreFlushContext
Flush the cache (create the new store file) A length operation which doesn't require locking out any function of the store.- Specified by:
flushCache
in interfaceStoreFlushContext
- Throws:
IOException
- in case the flush fails
-
commit
Description copied from interface:StoreFlushContext
Commit the flush - add the store file to the store and clear the memstore snapshot. Requires pausing scans. A very short operation- Specified by:
commit
in interfaceStoreFlushContext
- Returns:
- whether compaction is required
- Throws:
IOException
-
getOutputFileSize
Description copied from interface:StoreFlushContext
Returns the total file size for flush output files, in bytes- Specified by:
getOutputFileSize
in interfaceStoreFlushContext
-
getCommittedFiles
Description copied from interface:StoreFlushContext
Returns the newly committed files from the flush. Called only if commit returns true- Specified by:
getCommittedFiles
in 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:
replayFlush
in 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:
abort
in interfaceStoreFlushContext
- Throws:
IOException
-