org.apache.hadoop.hbase.mapred
Class TableInputFormatBase

java.lang.Object
  extended by org.apache.hadoop.hbase.mapred.TableInputFormatBase
All Implemented Interfaces:
org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,RowResult>
Direct Known Subclasses:
TableInputFormat

Deprecated.

@Deprecated
public abstract class TableInputFormatBase
extends Object
implements org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,RowResult>

A Base for TableInputFormats. Receives a HTable, a byte[] of input columns and optionally a RowFilterInterface. Subclasses may use other TableRecordReader implementations.

An example of a subclass:

   class ExampleTIF extends TableInputFormatBase implements JobConfigurable {

     public void configure(JobConf job) {
       HTable exampleTable = new HTable(new HBaseConfiguration(job),
         Bytes.toBytes("exampleTable"));
       // mandatory
       setHTable(exampleTable);
       Text[] inputColumns = new byte [][] { Bytes.toBytes("columnA"),
         Bytes.toBytes("columnB") };
       // mandatory
       setInputColumns(inputColumns);
       RowFilterInterface exampleFilter = new RegExpRowFilter("keyPrefix.*");
       // optional
       setRowFilter(exampleFilter);
     }

     public void validateInput(JobConf job) throws IOException {
     }
  }
 


Nested Class Summary
protected  class TableInputFormatBase.TableRecordReader
          Deprecated. Iterate over an HBase table data, return (Text, RowResult) pairs
 
Constructor Summary
TableInputFormatBase()
          Deprecated.  
 
Method Summary
protected  HTable getHTable()
          Deprecated. Allows subclasses to get the HTable.
 org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult> getRecordReader(org.apache.hadoop.mapred.InputSplit split, org.apache.hadoop.mapred.JobConf job, org.apache.hadoop.mapred.Reporter reporter)
          Deprecated. Builds a TableRecordReader.
 org.apache.hadoop.mapred.InputSplit[] getSplits(org.apache.hadoop.mapred.JobConf job, int numSplits)
          Deprecated. Calculates the splits that will serve as input for the map tasks.
protected  void setHTable(HTable table)
          Deprecated. Allows subclasses to set the HTable.
protected  void setInputColumns(byte[][] inputColumns)
          Deprecated.  
protected  void setRowFilter(RowFilterInterface rowFilter)
          Deprecated. Allows subclasses to set the RowFilterInterface to be used.
protected  void setTableRecordReader(TableInputFormatBase.TableRecordReader tableRecordReader)
          Deprecated. Allows subclasses to set the TableInputFormatBase.TableRecordReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableInputFormatBase

public TableInputFormatBase()
Deprecated. 
Method Detail

getRecordReader

public org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult> getRecordReader(org.apache.hadoop.mapred.InputSplit split,
                                                                                               org.apache.hadoop.mapred.JobConf job,
                                                                                               org.apache.hadoop.mapred.Reporter reporter)
                                                                                        throws IOException
Deprecated. 
Builds a TableRecordReader. If no TableRecordReader was provided, uses the default.

Specified by:
getRecordReader in interface org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,RowResult>
Throws:
IOException
See Also:
InputFormat.getRecordReader(InputSplit, JobConf, Reporter)

getSplits

public org.apache.hadoop.mapred.InputSplit[] getSplits(org.apache.hadoop.mapred.JobConf job,
                                                       int numSplits)
                                                throws IOException
Deprecated. 
Calculates the splits that will serve as input for the map tasks.

setInputColumns

protected void setInputColumns(byte[][] inputColumns)
Deprecated. 
Parameters:
inputColumns - to be passed in RowResult to the map task.

getHTable

protected HTable getHTable()
Deprecated. 
Allows subclasses to get the HTable.


setHTable

protected void setHTable(HTable table)
Deprecated. 
Allows subclasses to set the HTable.

Parameters:
table - to get the data from

setTableRecordReader

protected void setTableRecordReader(TableInputFormatBase.TableRecordReader tableRecordReader)
Deprecated. 
Allows subclasses to set the TableInputFormatBase.TableRecordReader.

Parameters:
tableRecordReader - to provide other TableInputFormatBase.TableRecordReader implementations.

setRowFilter

protected void setRowFilter(RowFilterInterface rowFilter)
Deprecated. 
Allows subclasses to set the RowFilterInterface to be used.

Parameters:
rowFilter -


Copyright © 2009 The Apache Software Foundation