org.apache.hadoop.hbase.mapreduce
Class TsvImporterMapper
java.lang.Object
org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
org.apache.hadoop.hbase.mapreduce.TsvImporterMapper
@InterfaceAudience.Public
@InterfaceStability.Stable
public class TsvImporterMapper
- extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
Write table content out to files in hdfs.
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
org.apache.hadoop.mapreduce.Mapper.Context |
Method Summary |
protected void |
doSetup(org.apache.hadoop.mapreduce.Mapper.Context context)
Handles common parameter initialization that a subclass might want to leverage. |
org.apache.hadoop.mapreduce.Counter |
getBadLineCount()
|
boolean |
getSkipBadLines()
|
long |
getTs()
|
void |
incrementBadLineCount(int count)
|
void |
map(org.apache.hadoop.io.LongWritable offset,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
Convert a line of TSV text into an HBase table row. |
protected void |
populatePut(byte[] lineBytes,
org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine parsed,
Put put,
int i)
|
protected void |
setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Handles initializing this class with objects specific to it (i.e., the parser). |
Methods inherited from class org.apache.hadoop.mapreduce.Mapper |
cleanup, run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ts
protected long ts
- Timestamp for all inserted rows
parser
protected ImportTsv.TsvParser parser
conf
protected org.apache.hadoop.conf.Configuration conf
cellVisibilityExpr
@InterfaceStability.Unstable
protected String cellVisibilityExpr
ttl
@InterfaceStability.Unstable
protected long ttl
kvCreator
protected CellCreator kvCreator
TsvImporterMapper
public TsvImporterMapper()
getTs
public long getTs()
getSkipBadLines
public boolean getSkipBadLines()
getBadLineCount
public org.apache.hadoop.mapreduce.Counter getBadLineCount()
incrementBadLineCount
public void incrementBadLineCount(int count)
setup
protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
- Handles initializing this class with objects specific to it (i.e., the parser).
Common initialization that might be leveraged by a subsclass is done in
doSetup
. Hence a subclass may choose to override this method
and call doSetup
as well before handling it's own custom params.
- Overrides:
setup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
- Parameters:
context
-
doSetup
protected void doSetup(org.apache.hadoop.mapreduce.Mapper.Context context)
- Handles common parameter initialization that a subclass might want to leverage.
- Parameters:
context
-
map
public void map(org.apache.hadoop.io.LongWritable offset,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException
- Convert a line of TSV text into an HBase table row.
- Overrides:
map
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
- Throws:
IOException
populatePut
protected void populatePut(byte[] lineBytes,
org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine parsed,
Put put,
int i)
throws ImportTsv.TsvParser.BadTsvLineException,
IOException
- Throws:
ImportTsv.TsvParser.BadTsvLineException
IOException
Copyright © 2015 The Apache Software Foundation. All rights reserved.