org.apache.hadoop.hbase.mapreduce
Class MultiTableInputFormat
java.lang.Object
org.apache.hadoop.mapreduce.InputFormat<ImmutableBytesWritable,Result>
org.apache.hadoop.hbase.mapreduce.MultiTableInputFormatBase
org.apache.hadoop.hbase.mapreduce.MultiTableInputFormat
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class MultiTableInputFormat
- extends MultiTableInputFormatBase
- implements org.apache.hadoop.conf.Configurable
Convert HBase tabular data from multiple scanners into a format that
is consumable by Map/Reduce.
Usage example
List scans = new ArrayList();
Scan scan1 = new Scan();
scan1.setStartRow(firstRow1);
scan1.setStopRow(lastRow1);
scan1.setAttribute(Scan.SCAN_ATTRIBUTES_TABLE_NAME, table1);
scans.add(scan1);
Scan scan2 = new Scan();
scan2.setStartRow(firstRow2);
scan2.setStopRow(lastRow2);
scan1.setAttribute(Scan.SCAN_ATTRIBUTES_TABLE_NAME, table2);
scans.add(scan2);
TableMapReduceUtil.initTableMapperJob(scans, TableMapper.class, Text.class,
IntWritable.class, job);
Field Summary |
static String |
SCANS
Job parameter that specifies the scan list. |
Method Summary |
org.apache.hadoop.conf.Configuration |
getConf()
Returns the current configuration. |
void |
setConf(org.apache.hadoop.conf.Configuration configuration)
Sets the configuration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCANS
public static final String SCANS
- Job parameter that specifies the scan list.
- See Also:
- Constant Field Values
MultiTableInputFormat
public MultiTableInputFormat()
getConf
public org.apache.hadoop.conf.Configuration getConf()
- Returns the current configuration.
- Specified by:
getConf
in interface org.apache.hadoop.conf.Configurable
- Returns:
- The current configuration.
- See Also:
Configurable.getConf()
setConf
public void setConf(org.apache.hadoop.conf.Configuration configuration)
- Sets the configuration. This is used to set the details for the tables to
be scanned.
- Specified by:
setConf
in interface org.apache.hadoop.conf.Configurable
- Parameters:
configuration
- The configuration to set.- See Also:
Configurable.setConf(
org.apache.hadoop.conf.Configuration)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.