org.apache.hadoop.hbase.mapreduce
Class MultiTableInputFormat

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputFormat<ImmutableBytesWritable,Result>
      extended by org.apache.hadoop.hbase.mapreduce.MultiTableInputFormatBase
          extended by 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.
 
Constructor Summary
MultiTableInputFormat()
           
 
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 org.apache.hadoop.hbase.mapreduce.MultiTableInputFormatBase
createRecordReader, getScans, getSplits, includeRegionInSplit, setScans, setTableRecordReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCANS

public static final String SCANS
Job parameter that specifies the scan list.

See Also:
Constant Field Values
Constructor Detail

MultiTableInputFormat

public MultiTableInputFormat()
Method Detail

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.