org.apache.hadoop.hbase.regionserver
Class DefaultStoreFlusher

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.DefaultStoreFlusher

public class DefaultStoreFlusher
extends Object

Default implementation of StoreFlusher.


Field Summary
protected  org.apache.hadoop.conf.Configuration conf
           
protected  Store store
           
 
Constructor Summary
DefaultStoreFlusher(org.apache.hadoop.conf.Configuration conf, Store store)
           
 
Method Summary
protected  InternalScanner createStoreScanner(long smallestReadPoint, KeyValueScanner memstoreScanner)
          Creates the default flush scanner based on memstore scanner
protected  void finalizeWriter(StoreFile.Writer writer, long cacheFlushSeqNum, MonitoredTask status)
           
 List<org.apache.hadoop.fs.Path> flushSnapshot(SortedSet<KeyValue> snapshot, long cacheFlushId, TimeRangeTracker snapshotTimeRangeTracker, AtomicLong flushedSize, MonitoredTask status)
          Turns a snapshot of memstore into a set of store files.
protected  long performFlush(InternalScanner scanner, Compactor.CellSink sink, long smallestReadPoint)
          Performs memstore flush, writing data from scanner into sink.
protected  InternalScanner postCreateCoprocScanner(InternalScanner scanner)
          Calls coprocessor to create a scanner based on default flush scanner
protected  InternalScanner preCreateCoprocScanner(KeyValueScanner memstoreScanner)
          Calls coprocessor to create a flush scanner based on memstore scanner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected org.apache.hadoop.conf.Configuration conf

store

protected Store store
Constructor Detail

DefaultStoreFlusher

public DefaultStoreFlusher(org.apache.hadoop.conf.Configuration conf,
                           Store store)
Method Detail

flushSnapshot

public List<org.apache.hadoop.fs.Path> flushSnapshot(SortedSet<KeyValue> snapshot,
                                                     long cacheFlushId,
                                                     TimeRangeTracker snapshotTimeRangeTracker,
                                                     AtomicLong flushedSize,
                                                     MonitoredTask status)
                                              throws IOException
Turns a snapshot of memstore into a set of store files.

Parameters:
snapshot - Memstore snapshot.
cacheFlushId - Log cache flush sequence number.
snapshotTimeRangeTracker - Time range tracker from the memstore pertaining to the snapshot.
flushedSize - Out parameter for the size of the KVs flushed.
status - Task that represents the flush operation and may be updated with status.
Returns:
List of files written. Can be empty; must not be null.
Throws:
IOException

finalizeWriter

protected void finalizeWriter(StoreFile.Writer writer,
                              long cacheFlushSeqNum,
                              MonitoredTask status)
                       throws IOException
Throws:
IOException

preCreateCoprocScanner

protected InternalScanner preCreateCoprocScanner(KeyValueScanner memstoreScanner)
                                          throws IOException
Calls coprocessor to create a flush scanner based on memstore scanner

Throws:
IOException

createStoreScanner

protected InternalScanner createStoreScanner(long smallestReadPoint,
                                             KeyValueScanner memstoreScanner)
                                      throws IOException
Creates the default flush scanner based on memstore scanner

Throws:
IOException

postCreateCoprocScanner

protected InternalScanner postCreateCoprocScanner(InternalScanner scanner)
                                           throws IOException
Calls coprocessor to create a scanner based on default flush scanner

Returns:
new or default scanner; if null, flush should not proceed.
Throws:
IOException

performFlush

protected long performFlush(InternalScanner scanner,
                            Compactor.CellSink sink,
                            long smallestReadPoint)
                     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.
smallestReadPoint - Smallest read point used for the flush.
Returns:
Bytes flushed. s
Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.