org.apache.hadoop.hbase.mapreduce
Class TextSortReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,KeyValue>
      extended by org.apache.hadoop.hbase.mapreduce.TextSortReducer

@InterfaceAudience.Public
@InterfaceStability.Evolving
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:
HFileOutputFormat, KeyValueSortReducer, PutSortReducer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
TextSortReducer()
           
 
Method Summary
protected  void doSetup(org.apache.hadoop.mapreduce.Reducer.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)
           
protected  void reduce(ImmutableBytesWritable rowKey, Iterable<org.apache.hadoop.io.Text> lines, org.apache.hadoop.mapreduce.Reducer.Context context)
           
protected  void setup(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextSortReducer

public TextSortReducer()
Method Detail

getTs

public long getTs()

getSkipBadLines

public boolean getSkipBadLines()

getBadLineCount

public org.apache.hadoop.mapreduce.Counter getBadLineCount()

incrementBadLineCount

public void incrementBadLineCount(int count)

setup

protected void setup(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 in doSetup. Hence a subclass may choose to override this method and call doSetup as well before handling it's own custom params.

Overrides:
setup in class org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,KeyValue>
Parameters:
context -

doSetup

protected void doSetup(org.apache.hadoop.mapreduce.Reducer.Context context)
Handles common parameter initialization that a subclass might want to leverage.

Parameters:
context -

reduce

protected void reduce(ImmutableBytesWritable rowKey,
                      Iterable<org.apache.hadoop.io.Text> lines,
                      org.apache.hadoop.mapreduce.Reducer.Context context)
               throws IOException,
                      InterruptedException
Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,org.apache.hadoop.io.Text,ImmutableBytesWritable,KeyValue>
Throws:
IOException
InterruptedException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.