@InterfaceAudience.Public public class TsvImporterMapper extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.mapreduce.Counter |
badLineCount |
protected String |
cellVisibilityExpr |
protected org.apache.hadoop.conf.Configuration |
conf |
private String |
hfileOutPath |
protected CellCreator |
kvCreator |
private boolean |
logBadLines |
protected ImportTsv.TsvParser |
parser |
private String |
separator
Column seperator
|
private boolean |
skipBadLines
Should skip bad lines
|
private boolean |
skipEmptyColumns
Should skip empty columns
|
private List<Tag> |
tags
List of cell tags
|
protected long |
ts
Timestamp for all inserted rows
|
protected long |
ttl |
Constructor and Description |
---|
TsvImporterMapper() |
Modifier and Type | Method and Description |
---|---|
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,
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).
|
protected long ts
private boolean skipBadLines
private boolean skipEmptyColumns
private org.apache.hadoop.mapreduce.Counter badLineCount
private boolean logBadLines
protected ImportTsv.TsvParser parser
protected org.apache.hadoop.conf.Configuration conf
protected String cellVisibilityExpr
protected long ttl
protected CellCreator kvCreator
private String hfileOutPath
public TsvImporterMapper()
public long getTs()
public boolean getSkipBadLines()
public org.apache.hadoop.mapreduce.Counter getBadLineCount()
public void incrementBadLineCount(int count)
protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
doSetup
. Hence a subclass may choose to override this method
and call doSetup
as well before handling it's own custom params.setup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
context
- protected void doSetup(org.apache.hadoop.mapreduce.Mapper.Context context)
context
- public void map(org.apache.hadoop.io.LongWritable offset, org.apache.hadoop.io.Text value, org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException
map
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,Put>
IOException
protected void populatePut(byte[] lineBytes, ImportTsv.TsvParser.ParsedLine parsed, Put put, int i) throws ImportTsv.TsvParser.BadTsvLineException, IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.