Class CompactionTool.CompactionWorker

java.lang.Object
org.apache.hadoop.hbase.regionserver.CompactionTool.CompactionWorker
Enclosing class:
CompactionTool

private static class CompactionTool.CompactionWorker extends Object
Class responsible to execute the Compaction on the specified path. The path can be a table, region or family directory.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.apache.hadoop.conf.Configuration
     
    private final boolean
     
    private final org.apache.hadoop.fs.FileSystem
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompactionWorker(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    compact(org.apache.hadoop.fs.Path path, boolean compactOnce, boolean major)
    Execute the compaction on the specified path.
    private void
    compactRegion(org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, org.apache.hadoop.fs.Path regionDir, boolean compactOnce, boolean major)
     
    private void
    compactStoreFiles(org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, RegionInfo hri, String familyName, boolean compactOnce, boolean major)
    Execute the actual compaction job.
    private void
    compactTable(org.apache.hadoop.fs.Path tableDir, boolean compactOnce, boolean major)
     
    private static HStore
    getStore(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, RegionInfo hri, String familyName)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • deleteCompacted

      private final boolean deleteCompacted
    • conf

      private final org.apache.hadoop.conf.Configuration conf
    • fs

      private final org.apache.hadoop.fs.FileSystem fs
  • Constructor Details

    • CompactionWorker

      public CompactionWorker(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • compact

      public void compact(org.apache.hadoop.fs.Path path, boolean compactOnce, boolean major) throws IOException
      Execute the compaction on the specified path.
      Parameters:
      path - Directory path on which to run compaction.
      compactOnce - Execute just a single step of compaction.
      major - Request major compaction.
      Throws:
      IOException
    • compactTable

      private void compactTable(org.apache.hadoop.fs.Path tableDir, boolean compactOnce, boolean major) throws IOException
      Throws:
      IOException
    • compactRegion

      private void compactRegion(org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, org.apache.hadoop.fs.Path regionDir, boolean compactOnce, boolean major) throws IOException
      Throws:
      IOException
    • compactStoreFiles

      private void compactStoreFiles(org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, RegionInfo hri, String familyName, boolean compactOnce, boolean major) throws IOException
      Execute the actual compaction job. If the compact once flag is not specified, execute the compaction until no more compactions are needed. Uses the Configuration settings provided.
      Throws:
      IOException
    • getStore

      private static HStore getStore(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, TableDescriptor htd, RegionInfo hri, String familyName) throws IOException
      Throws:
      IOException