public class TableInputFormat extends Object implements InputFormat<Record,TableInputSplit>
InputFormat subclass that wraps the access for HTables.| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_LOCATION
Location of the hbase-site.xml.
|
protected HBaseKey |
hbaseKey
mutable objects that are used to avoid recreation of wrapper objects
|
protected HBaseResult |
hbaseResult |
static String |
INPUT_TABLE
Job parameter that specifies the input table.
|
static String |
SCAN
Base-64 encoded scanner.
|
static String |
SCAN_CACHEBLOCKS
Set to false to disable server-side caching of blocks for this scan.
|
static String |
SCAN_CACHEDROWS
The number of rows for caching that will be passed to scanners.
|
static String |
SCAN_COLUMN_FAMILY
Column Family to Scan
|
static String |
SCAN_COLUMNS
Space delimited list of columns to scan.
|
static String |
SCAN_MAXVERSIONS
The maximum number of version to return.
|
static String |
SCAN_TIMERANGE_END
The ending timestamp used to filter columns with a specific range of versions.
|
static String |
SCAN_TIMERANGE_START
The starting timestamp used to filter columns with a specific range of versions.
|
static String |
SCAN_TIMESTAMP
The timestamp used to filter columns with a specific timestamp.
|
| Constructor and Description |
|---|
TableInputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Configuration parameters) |
TableInputSplit[] |
createInputSplits(int minNumSplits) |
protected org.apache.hadoop.hbase.client.Scan |
createScanner(Configuration parameters)
Read the configuration and creates a
Scan object. |
protected org.apache.hadoop.hbase.client.HTable |
createTable(Configuration parameters)
Create an
HTable instance and set it into this format. |
Class<TableInputSplit> |
getInputSplitType() |
org.apache.hadoop.hbase.client.Scan |
getScan() |
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics) |
org.apache.hadoop.hbase.client.HTable |
getTable() |
void |
mapResultToRecord(Record record,
HBaseKey key,
HBaseResult result)
Maps the current HBase Result into a Record.
|
Record |
nextRecord(Record record) |
protected boolean |
nextResult() |
void |
open(TableInputSplit split) |
boolean |
reachedEnd() |
void |
setScan(org.apache.hadoop.hbase.client.Scan scan) |
void |
setTable(org.apache.hadoop.hbase.client.HTable table) |
public static final String INPUT_TABLE
public static final String CONFIG_LOCATION
public static final String SCAN
TableMapReduceUtil#convertScanToString(Scan) for more details.public static final String SCAN_COLUMN_FAMILY
public static final String SCAN_COLUMNS
public static final String SCAN_TIMESTAMP
public static final String SCAN_TIMERANGE_START
public static final String SCAN_TIMERANGE_END
public static final String SCAN_MAXVERSIONS
public static final String SCAN_CACHEBLOCKS
public static final String SCAN_CACHEDROWS
protected HBaseKey hbaseKey
protected HBaseResult hbaseResult
public void configure(Configuration parameters)
configure in interface InputFormat<Record,TableInputSplit>protected org.apache.hadoop.hbase.client.Scan createScanner(Configuration parameters)
Scan object.parameters - protected org.apache.hadoop.hbase.client.HTable createTable(Configuration parameters)
HTable instance and set it into this format.parameters - a Configuration that holds at least the table name.public BaseStatistics getStatistics(BaseStatistics cachedStatistics)
getStatistics in interface InputFormat<Record,TableInputSplit>public boolean reachedEnd()
throws IOException
reachedEnd in interface InputFormat<Record,TableInputSplit>IOExceptionprotected boolean nextResult()
throws IOException
IOExceptionpublic Record nextRecord(Record record) throws IOException
nextRecord in interface InputFormat<Record,TableInputSplit>IOExceptionpublic void mapResultToRecord(Record record, HBaseKey key, HBaseResult result)
record - key - result - public void close()
throws IOException
close in interface InputFormat<Record,TableInputSplit>IOExceptionpublic void open(TableInputSplit split) throws IOException
open in interface InputFormat<Record,TableInputSplit>IOExceptionpublic TableInputSplit[] createInputSplits(int minNumSplits) throws IOException
createInputSplits in interface InputFormat<Record,TableInputSplit>IOExceptionpublic Class<TableInputSplit> getInputSplitType()
getInputSplitType in interface InputFormat<Record,TableInputSplit>public void setTable(org.apache.hadoop.hbase.client.HTable table)
public org.apache.hadoop.hbase.client.HTable getTable()
public void setScan(org.apache.hadoop.hbase.client.Scan scan)
public org.apache.hadoop.hbase.client.Scan getScan()
Copyright © 2013–2014. All rights reserved.