Class CellCounter
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.mapreduce.CellCounter
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
@Public
public class CellCounter
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
A job with a a map and reduce phase to count cells in a table. The counter lists the following
stats for a given table:
1. Total number of rows in the table 2. Total number of CFs across all rows 3. Total qualifiers across all rows 4. Total occurrence of each CF 5. Total occurrence of each qualifier 6. Total number of versions of each qualifier. 7. Total size of serialized cells of each CF. 8. Total size of serialized cells of each qualifier. 9. Total size of serialized cells across all rows.The cellcounter can take optional parameters to use a user supplied row/family/qualifier string to use in the report and second a regex based or prefix based row filter to restrict the count operation to a limited subset of rows from the table or a start time and/or end time to limit the count to a time range.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Mapper that runs the count.(package private) static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.mapreduce.Job
createSubmittableJob
(org.apache.hadoop.conf.Configuration conf, String[] args) Sets up the actual job.private static Scan
getConfiguredScanForJob
(org.apache.hadoop.conf.Configuration conf, String[] args) private static Filter
getRowFilter
(String[] args) private static long[]
getTimeRange
(String[] args) static void
Main entry point.private void
printUsage
(int parameterCount) 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
-
NAME
Name of this 'program'.- See Also:
-
JOB_NAME_CONF_KEY
- See Also:
-
-
Constructor Details
-
CellCounter
public CellCounter()
-
-
Method Details
-
createSubmittableJob
public static org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException Sets up the actual job.- Parameters:
conf
- The current configuration.args
- The command line parameters.- Returns:
- The newly created job.
- Throws:
IOException
- When setting up the job fails.
-
getConfiguredScanForJob
private static Scan getConfiguredScanForJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException - Throws:
IOException
-
getRowFilter
-
getTimeRange
- Throws:
IOException
-
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
printUsage
-
main
Main entry point.- Parameters:
args
- The command line parameters.- Throws:
Exception
- When running the job fails.
-