org.apache.hadoop.hbase.regionserver.compactions
Class DefaultCompactor

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.compactions.Compactor
      extended by org.apache.hadoop.hbase.regionserver.compactions.DefaultCompactor

@InterfaceAudience.Private
public class DefaultCompactor
extends Compactor

Compact passed set of files. Create an instance and then call compact(CompactionRequest, CompactionThroughputController)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.compactions.Compactor
Compactor.CellSink, Compactor.FileDetails
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.compactions.Compactor
compactionCompression, conf, progress, store
 
Constructor Summary
DefaultCompactor(org.apache.hadoop.conf.Configuration conf, Store store)
           
 
Method Summary
 List<org.apache.hadoop.fs.Path> compact(CompactionRequest request, CompactionThroughputController throughputController)
          Do a minor/major compaction on an explicit set of storefiles from a Store.
 List<org.apache.hadoop.fs.Path> compactForTesting(Collection<StoreFile> filesToCompact, boolean isMajor)
          Compact a list of files for testing.
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.compactions.Compactor
createFileScanners, createScanner, createScanner, getFileDetails, getProgress, getSmallestReadPoint, performCompaction, postCreateCoprocScanner, preCreateCoprocScanner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompactor

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

compact

public List<org.apache.hadoop.fs.Path> compact(CompactionRequest request,
                                               CompactionThroughputController throughputController)
                                        throws IOException
Do a minor/major compaction on an explicit set of storefiles from a Store.

Throws:
IOException

compactForTesting

public List<org.apache.hadoop.fs.Path> compactForTesting(Collection<StoreFile> filesToCompact,
                                                         boolean isMajor)
                                                  throws IOException
Compact a list of files for testing. Creates a fake CompactionRequest to pass to compact(CompactionRequest, CompactionThroughputController);

Parameters:
filesToCompact - the files to compact. These are used as the compactionSelection for the generated CompactionRequest.
isMajor - true to major compact (prune all deletes, max versions, etc)
Returns:
Product of compaction or an empty list if all cells expired or deleted and nothing \ made it through the compaction.
Throws:
IOException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.