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
@Public
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 Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.mapreduce.Counterprotected Stringprotected org.apache.hadoop.conf.Configurationprivate Stringprotected CellCreatorprivate static final org.slf4j.Loggerprivate booleanprotected ImportTsv.TsvParserprivate StringColumn seperatorprivate booleanShould skip bad linesprivate booleanShould skip empty columnsList of cell tagsprotected longTimestamp for all inserted rowsprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoSetup(org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>.org.apache.hadoop.mapreduce.Mapper.Context context) Handles common parameter initialization that a subclass might want to leverage.org.apache.hadoop.mapreduce.CounterbooleanlonggetTs()voidincrementBadLineCount(int count) voidmap(org.apache.hadoop.io.LongWritable offset, org.apache.hadoop.io.Text value, org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>.org.apache.hadoop.mapreduce.Mapper.Context context) Convert a line of TSV text into an HBase table row.protected voidpopulatePut(byte[] lineBytes, ImportTsv.TsvParser.ParsedLine parsed, Put put, int i) protected voidsetup(org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>.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
-
Field Details
-
LOG
-
ts
Timestamp for all inserted rows -
separator
Column seperator -
skipBadLines
Should skip bad lines -
skipEmptyColumns
Should skip empty columns -
badLineCount
-
logBadLines
-
parser
-
conf
-
cellVisibilityExpr
-
ttl
-
kvCreator
-
hfileOutPath
-
tags
List of cell tags
-
-
Constructor Details
-
TsvImporterMapper
public TsvImporterMapper()
-
-
Method Details
-
getTs
-
getSkipBadLines
-
getBadLineCount
-
incrementBadLineCount
-
setup
protected void setup(org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>.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 indoSetup. Hence a subclass may choose to override this method and calldoSetupas well before handling it's own custom params.- Overrides:
setupin classorg.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>
-
doSetup
protected void doSetup(org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, Put>.org.apache.hadoop.mapreduce.Mapper.Context context) Handles common parameter initialization that a subclass might want to leverage. -
map
public void map(org.apache.hadoop.io.LongWritable offset, org.apache.hadoop.io.Text value, org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text, throws IOExceptionImmutableBytesWritable, Put>.org.apache.hadoop.mapreduce.Mapper.Context context) Convert a line of TSV text into an HBase table row.- Overrides:
mapin classorg.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text, ImmutableBytesWritable, Put> - Throws:
IOException
-
populatePut
protected void populatePut(byte[] lineBytes, ImportTsv.TsvParser.ParsedLine parsed, Put put, int i) throws ImportTsv.TsvParser.BadTsvLineException, IOException
-