Class CompactionTool
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.regionserver.CompactionTool
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
@LimitedPrivate("Tools")
public class CompactionTool
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Input format that uses store files block location as input split locality.private static class
private static class
Class responsible to execute the Compaction on the specified path. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate int
doClient
(org.apache.hadoop.fs.FileSystem fs, Set<org.apache.hadoop.fs.Path> toCompactDirs, boolean compactOnce, boolean major) Execute compaction, from this client, one path at the time.private int
doMapReduce
(org.apache.hadoop.fs.FileSystem fs, Set<org.apache.hadoop.fs.Path> toCompactDirs, boolean compactOnce, boolean major) Execute compaction, using a Map-Reduce job.private static boolean
isFamilyDir
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) private static boolean
isRegionDir
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) private static boolean
isTableDir
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) static void
private void
private void
printUsage
(String message) int
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
LOG
-
CONF_COMPACT_ONCE
- See Also:
-
CONF_COMPACT_MAJOR
- See Also:
-
CONF_DELETE_COMPACTED
- See Also:
-
-
Constructor Details
-
CompactionTool
public CompactionTool()
-
-
Method Details
-
isRegionDir
private static boolean isRegionDir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
isTableDir
private static boolean isTableDir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
isFamilyDir
private static boolean isFamilyDir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
doMapReduce
private int doMapReduce(org.apache.hadoop.fs.FileSystem fs, Set<org.apache.hadoop.fs.Path> toCompactDirs, boolean compactOnce, boolean major) throws Exception Execute compaction, using a Map-Reduce job.- Throws:
Exception
-
doClient
private int doClient(org.apache.hadoop.fs.FileSystem fs, Set<org.apache.hadoop.fs.Path> toCompactDirs, boolean compactOnce, boolean major) throws IOException Execute compaction, from this client, one path at the time.- Throws:
IOException
-
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
printUsage
-
printUsage
-
main
- Throws:
Exception
-