org.apache.hadoop.hbase.mapred
Class TableRecordReaderImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.mapred.TableRecordReaderImpl

public class TableRecordReaderImpl
extends Object

Iterate over an HBase table data, return (Text, RowResult) pairs


Constructor Summary
TableRecordReaderImpl()
           
 
Method Summary
 void close()
           
 ImmutableBytesWritable createKey()
           
 Result createValue()
           
 long getPos()
           
 float getProgress()
           
 void init()
          Build the scanner.
 boolean next(ImmutableBytesWritable key, Result value)
           
 void restart(byte[] firstRow)
          Restart from survivable exceptions by creating a new scanner.
 void setEndRow(byte[] endRow)
           
 void setHTable(HTable htable)
           
 void setInputColumns(byte[][] inputColumns)
           
 void setRowFilter(Filter rowFilter)
           
 void setStartRow(byte[] startRow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableRecordReaderImpl

public TableRecordReaderImpl()
Method Detail

restart

public void restart(byte[] firstRow)
             throws IOException
Restart from survivable exceptions by creating a new scanner.

Parameters:
firstRow -
Throws:
IOException

init

public void init()
          throws IOException
Build the scanner. Not done in constructor to allow for extension.

Throws:
IOException

setHTable

public void setHTable(HTable htable)
Parameters:
htable - the HTable to scan.

setInputColumns

public void setInputColumns(byte[][] inputColumns)
Parameters:
inputColumns - the columns to be placed in Result.

setStartRow

public void setStartRow(byte[] startRow)
Parameters:
startRow - the first row in the split

setEndRow

public void setEndRow(byte[] endRow)
Parameters:
endRow - the last row in the split

setRowFilter

public void setRowFilter(Filter rowFilter)
Parameters:
rowFilter - the Filter to be used.

close

public void close()

createKey

public ImmutableBytesWritable createKey()
Returns:
ImmutableBytesWritable
See Also:
RecordReader.createKey()

createValue

public Result createValue()
Returns:
RowResult
See Also:
RecordReader.createValue()

getPos

public long getPos()

getProgress

public float getProgress()

next

public boolean next(ImmutableBytesWritable key,
                    Result value)
             throws IOException
Parameters:
key - HStoreKey as input key.
value - MapWritable as input value
Returns:
true if there was more data
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.