@InterfaceAudience.Public
public class TableRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>
| Constructor and Description |
|---|
TableRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the split.
|
org.apache.hadoop.hbase.io.ImmutableBytesWritable |
getCurrentKey()
Returns the current key.
|
org.apache.hadoop.hbase.client.Result |
getCurrentValue()
Returns the current value.
|
float |
getProgress()
The current progress of the record reader through its data.
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit inputsplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Initializes the reader.
|
boolean |
nextKeyValue()
Positions the record reader to the next record.
|
void |
restart(byte[] firstRow)
Restart from survivable exceptions by creating a new scanner.
|
void |
setScan(org.apache.hadoop.hbase.client.Scan scan)
Sets the scan defining the actual details like columns etc.
|
void |
setTable(org.apache.hadoop.hbase.client.Table table) |
public void restart(byte[] firstRow)
throws IOException
firstRow - The first row to start at.IOException - When restarting fails.public void setTable(org.apache.hadoop.hbase.client.Table table)
table - the Table to scan.public void setScan(org.apache.hadoop.hbase.client.Scan scan)
scan - The scan to set.public void close()
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>RecordReader.close()public org.apache.hadoop.hbase.io.ImmutableBytesWritable getCurrentKey()
throws IOException,
InterruptedException
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>IOExceptionInterruptedException - When the job is aborted.RecordReader.getCurrentKey()public org.apache.hadoop.hbase.client.Result getCurrentValue()
throws IOException,
InterruptedException
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>IOException - When the value is faulty.InterruptedException - When the job is aborted.RecordReader.getCurrentValue()public void initialize(org.apache.hadoop.mapreduce.InputSplit inputsplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws IOException,
InterruptedException
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>inputsplit - The split to work with.context - The current task context.IOException - When setting up the reader fails.InterruptedException - When the job is aborted.RecordReader.initialize(
org.apache.hadoop.mapreduce.InputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext)public boolean nextKeyValue()
throws IOException,
InterruptedException
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>true if there was another record.IOException - When reading the record failed.InterruptedException - When the job was aborted.RecordReader.nextKeyValue()public float getProgress()
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>RecordReader.getProgress()Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.