public class BigtableTableRecordReader extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOG_PER_ROW_COUNT |
Constructor and Description |
---|
BigtableTableRecordReader() |
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)
Build the scanner.
|
boolean |
nextKeyValue()
Positions the record reader to the next record.
|
void |
restart()
Restart from survivable exceptions by creating a new scanner.
|
protected static Method |
retrieveGetCounterWithStringsParams(org.apache.hadoop.mapreduce.TaskAttemptContext context)
In new mapreduce APIs, TaskAttemptContext has two getCounter methods
Check if getCounter(String, String) method is available.
|
void |
setHTable(org.apache.hadoop.hbase.client.Table htable)
Sets the HBase table.
|
void |
setScan(com.google.cloud.bigtable.hbase.BigtableExtendedScan scan)
Sets the scan defining the actual details like columns etc.
|
protected static void |
updateCounters(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics,
Method getCounter,
org.apache.hadoop.mapreduce.TaskAttemptContext context,
long numStale) |
public static final String LOG_PER_ROW_COUNT
public void restart() throws IOException
IOException
- When restarting fails.protected static Method retrieveGetCounterWithStringsParams(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException
IOException
public void setHTable(org.apache.hadoop.hbase.client.Table htable)
htable
- The HTableDescriptor
to scan.public void setScan(com.google.cloud.bigtable.hbase.BigtableExtendedScan scan)
scan
- The scan to set.public void initialize(org.apache.hadoop.mapreduce.InputSplit inputsplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
IOException
InterruptedException
public void close()
public org.apache.hadoop.hbase.io.ImmutableBytesWritable getCurrentKey() throws IOException, InterruptedException
IOException
InterruptedException
- When the job is aborted.public org.apache.hadoop.hbase.client.Result getCurrentValue() throws IOException, InterruptedException
IOException
- When the value is faulty.InterruptedException
- When the job is aborted.public boolean nextKeyValue() throws IOException, InterruptedException
true
if there was another record.IOException
- When reading the record failed.InterruptedException
- When the job was aborted.protected static void updateCounters(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics, Method getCounter, org.apache.hadoop.mapreduce.TaskAttemptContext context, long numStale)
public float getProgress()
Copyright © 2013–2019. All rights reserved.