This project has retired. For details please refer to its Attic page.
SFunction2 (Apache Crunch 0.11.0 API)

org.apache.crunch.fn
Class SFunction2<K,V,R>

java.lang.Object
  extended by org.apache.crunch.DoFn<S,T>
      extended by org.apache.crunch.MapFn<T,R>
          extended by org.apache.crunch.fn.SFunction2<K,V,R>
All Implemented Interfaces:
Serializable, org.apache.spark.api.java.function.Function2<K,V,R>

public abstract class SFunction2<K,V,R>
extends MapFn<T,R>
implements org.apache.spark.api.java.function.Function2<K,V,R>

A Crunch-compatible abstract base class for Spark's Function2. Subclasses of this class may be used against either Crunch PCollections or Spark RDDs.

See Also:
Serialized Form

Constructor Summary
SFunction2()
           
 
Method Summary
 void cleanup(Emitter<R> emitter)
          Called during the cleanup of the MapReduce job this DoFn is associated with.
 void initialize()
          Initialize this DoFn.
 R map(Pair<K,V> input)
          Maps the given input into an instance of the output type.
 
Methods inherited from class org.apache.crunch.MapFn
process, scaleFactor
 
Methods inherited from class org.apache.crunch.DoFn
configure, disableDeepCopy, setConfiguration, setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.api.java.function.Function2
call
 

Constructor Detail

SFunction2

public SFunction2()
Method Detail

map

public R map(Pair<K,V> input)
Description copied from class: MapFn
Maps the given input into an instance of the output type.

Specified by:
map in class MapFn<Pair<K,V>,R>

initialize

public final void initialize()
Description copied from class: DoFn
Initialize this DoFn. This initialization will happen before the actual DoFn.process(Object, Emitter) is triggered. Subclasses may override this method to do appropriate initialization.

Called during the setup of the job instance this DoFn is associated with.

Overrides:
initialize in class DoFn<T,R>

cleanup

public final void cleanup(Emitter<R> emitter)
Description copied from class: DoFn
Called during the cleanup of the MapReduce job this DoFn is associated with. Subclasses may override this method to do appropriate cleanup.

Overrides:
cleanup in class DoFn<T,R>
Parameters:
emitter - The emitter that was used for output


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.