@InterfaceAudience.Public public class TsvImporterTextMapper extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,org.apache.hadoop.io.Text>
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.mapreduce.Counter |
badLineCount |
private static org.slf4j.Logger |
LOG |
private boolean |
logBadLines |
private ImportTsv.TsvParser |
parser |
private String |
separator
Column seperator
|
private boolean |
skipBadLines
Should skip bad lines
|
Constructor and Description |
---|
TsvImporterTextMapper() |
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() |
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 |
setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Handles initializing this class with objects specific to it (i.e., the parser).
|
private static final org.slf4j.Logger LOG
private boolean skipBadLines
private org.apache.hadoop.mapreduce.Counter badLineCount
private boolean logBadLines
private ImportTsv.TsvParser parser
public TsvImporterTextMapper()
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,org.apache.hadoop.io.Text>
protected void doSetup(org.apache.hadoop.mapreduce.Mapper.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,org.apache.hadoop.io.Text>
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.