@InterfaceAudience.Public public class RowCounter extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
Modifier and Type | Class and Description |
---|---|
(package private) static class |
RowCounter.RowCounterMapper
Mapper that runs the count.
|
Modifier and Type | Field and Description |
---|---|
private static String |
EXPECTED_COUNT_KEY |
private static String |
JOB_NAME_CONF_KEY |
private static org.slf4j.Logger |
LOG |
(package private) static String |
NAME
Name of this 'program'.
|
Constructor and Description |
---|
RowCounter() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.mapreduce.Job |
createSubmittableJob(org.apache.hadoop.conf.Configuration conf,
String[] args)
Sets up the actual job.
|
static void |
main(String[] args)
Main entry point.
|
private static List<MultiRowRangeFilter.RowRange> |
parseRowRangeParameter(String arg,
String rangeSwitch) |
private static void |
printUsage()
Prints usage without error message.
|
private static void |
printUsage(String errorMessage) |
int |
run(String[] args) |
private static void |
setScanFilter(Scan scan,
List<MultiRowRangeFilter.RowRange> rowRangeList)
Sets filter
FilterBase to the Scan instance. |
private static final org.slf4j.Logger LOG
static final String NAME
private static final String JOB_NAME_CONF_KEY
private static final String EXPECTED_COUNT_KEY
public RowCounter()
public static org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException
conf
- The current configuration.args
- The command line parameters.IOException
- When setting up the job fails.private static List<MultiRowRangeFilter.RowRange> parseRowRangeParameter(String arg, String rangeSwitch)
private static void setScanFilter(Scan scan, List<MultiRowRangeFilter.RowRange> rowRangeList)
FilterBase
to the Scan
instance.
If provided rowRangeList contains more than one element,
method sets filter which is instance of MultiRowRangeFilter
.
Otherwise, method sets filter which is instance of FirstKeyOnlyFilter
.
If rowRangeList contains exactly one element, startRow and stopRow are set to the scan.scan
- rowRangeList
- private static void printUsage(String errorMessage)
private static void printUsage()
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.