Class TextSortReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,KeyValue>
org.apache.hadoop.hbase.mapreduce.TextSortReducer
@Public
public class TextSortReducer
extends org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,KeyValue>
Emits Sorted KeyValues. Parse the passed text and creates KeyValues. Sorts them before emit.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.mapreduce.Counter
private String
Cell visibility exprprivate CellCreator
private ImportTsv.TsvParser
private String
Column seperatorprivate boolean
Should skip bad linesprivate long
Timestamp for all inserted rowsprivate long
Cell TTL -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doSetup
(org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.Context context, org.apache.hadoop.conf.Configuration conf) Handles common parameter initialization that a subclass might want to leverage.org.apache.hadoop.mapreduce.Counter
boolean
long
getTs()
void
incrementBadLineCount
(int count) protected void
reduce
(ImmutableBytesWritable rowKey, Iterable<org.apache.hadoop.io.Text> lines, org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.Context context) protected void
setup
(org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.Context context) Handles initializing this class with objects specific to it (i.e., the parser).Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run
-
Field Details
-
ts
Timestamp for all inserted rows -
separator
Column seperator -
skipBadLines
Should skip bad lines -
badLineCount
-
parser
-
cellVisibilityExpr
Cell visibility expr -
ttl
Cell TTL -
kvCreator
-
-
Constructor Details
-
TextSortReducer
public TextSortReducer()
-
-
Method Details
-
getTs
-
getSkipBadLines
-
getBadLineCount
-
incrementBadLineCount
-
setup
protected void setup(org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.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 calldoSetup
as well before handling it's own custom params.- Overrides:
setup
in classorg.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,
org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>
-
doSetup
protected void doSetup(org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.Context context, org.apache.hadoop.conf.Configuration conf) Handles common parameter initialization that a subclass might want to leverage. -
reduce
protected void reduce(ImmutableBytesWritable rowKey, Iterable<org.apache.hadoop.io.Text> lines, org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable, org.apache.hadoop.io.Text, throws IOException, InterruptedExceptionImmutableBytesWritable, KeyValue>.org.apache.hadoop.mapreduce.Reducer.Context context) - Overrides:
reduce
in classorg.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,
org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue> - Throws:
IOException
InterruptedException
-