Class StoreFlusher
java.lang.Object
org.apache.hadoop.hbase.regionserver.StoreFlusher
- Direct Known Subclasses:
DefaultStoreFlusher
,StripeStoreFlusher
Store flusher interface. Turns a snapshot of memstore into a set of store files (usually one).
Custom implementation can be provided.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final InternalScanner
createScanner
(List<KeyValueScanner> snapshotScanners, FlushLifeCycleTracker tracker) Creates the scanner for flushing snapshot.protected final StoreFileWriter
createWriter
(MemStoreSnapshot snapshot, boolean alwaysIncludesTag, Consumer<org.apache.hadoop.fs.Path> writerCreationTracker) protected void
finalizeWriter
(StoreFileWriter writer, long cacheFlushSeqNum, MonitoredTask status) abstract List<org.apache.hadoop.fs.Path>
flushSnapshot
(MemStoreSnapshot snapshot, long cacheFlushSeqNum, MonitoredTask status, ThroughputController throughputController, FlushLifeCycleTracker tracker, Consumer<org.apache.hadoop.fs.Path> writerCreationTracker) Turns a snapshot of memstore into a set of store files.protected void
performFlush
(InternalScanner scanner, CellSink sink, ThroughputController throughputController) Performs memstore flush, writing data from scanner into sink.
-
Field Details
-
conf
-
store
-
-
Constructor Details
-
StoreFlusher
-
-
Method Details
-
flushSnapshot
public abstract List<org.apache.hadoop.fs.Path> flushSnapshot(MemStoreSnapshot snapshot, long cacheFlushSeqNum, MonitoredTask status, ThroughputController throughputController, FlushLifeCycleTracker tracker, Consumer<org.apache.hadoop.fs.Path> writerCreationTracker) throws IOException Turns a snapshot of memstore into a set of store files.- Parameters:
snapshot
- Memstore snapshot.cacheFlushSeqNum
- Log cache flush sequence number.status
- Task that represents the flush operation and may be updated with status.throughputController
- A controller to avoid flush too fast- Returns:
- List of files written. Can be empty; must not be null.
- Throws:
IOException
-
finalizeWriter
protected void finalizeWriter(StoreFileWriter writer, long cacheFlushSeqNum, MonitoredTask status) throws IOException - Throws:
IOException
-
createWriter
protected final StoreFileWriter createWriter(MemStoreSnapshot snapshot, boolean alwaysIncludesTag, Consumer<org.apache.hadoop.fs.Path> writerCreationTracker) throws IOException - Throws:
IOException
-
createScanner
protected final InternalScanner createScanner(List<KeyValueScanner> snapshotScanners, FlushLifeCycleTracker tracker) throws IOException Creates the scanner for flushing snapshot. Also calls coprocessors.- Returns:
- The scanner; null if coprocessor is canceling the flush.
- Throws:
IOException
-
performFlush
protected void performFlush(InternalScanner scanner, CellSink sink, ThroughputController throughputController) throws IOException Performs memstore flush, writing data from scanner into sink.- Parameters:
scanner
- Scanner to get data from.sink
- Sink to write data to. Could be StoreFile.Writer.throughputController
- A controller to avoid flush too fast- Throws:
IOException
-