Class CompactionTool.CompactionWorker
java.lang.Object
org.apache.hadoop.hbase.regionserver.CompactionTool.CompactionWorker
- Enclosing class:
- CompactionTool
Class responsible to execute the Compaction on the specified path. The path can be a table,
region or family directory.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
private final boolean
private final org.apache.hadoop.fs.FileSystem
-
Constructor Summary
ConstructorDescriptionCompactionWorker
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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)
-
Field Details
-
deleteCompacted
-
conf
-
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
-