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
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.mapreduce.Counterprivate StringCell visibility exprprivate CellCreatorprivate ImportTsv.TsvParserprivate StringColumn seperatorprivate booleanShould skip bad linesprivate longTimestamp for all inserted rowsprivate longCell TTL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoSetup(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.CounterbooleanlonggetTs()voidincrementBadLineCount(int count) protected voidreduce(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 voidsetup(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 calldoSetupas well before handling it's own custom params.- Overrides:
setupin 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:
reducein classorg.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text, ImmutableBytesWritable, KeyValue> - Throws:
IOExceptionInterruptedException
-