This project has retired. For details please refer to its Attic page.
Protos.TextToProtoFn (Apache Crunch 0.4.0-incubating API)

org.apache.crunch.types
Class Protos.TextToProtoFn<M extends com.google.protobuf.Message>

java.lang.Object
  extended by org.apache.crunch.DoFn<String,M>
      extended by org.apache.crunch.types.Protos.TextToProtoFn<M>
All Implemented Interfaces:
Serializable
Enclosing class:
Protos

public static class Protos.TextToProtoFn<M extends com.google.protobuf.Message>
extends DoFn<String,M>

See Also:
Serialized Form

Constructor Summary
Protos.TextToProtoFn(String sep, Class<M> msgClass)
           
 
Method Summary
 void initialize()
          Initialize this DoFn.
 void process(String input, Emitter<M> emitter)
          Processes the records from a PCollection.
 
Methods inherited from class org.apache.crunch.DoFn
cleanup, configure, scaleFactor, setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Protos.TextToProtoFn

public Protos.TextToProtoFn(String sep,
                            Class<M> msgClass)
Method Detail

initialize

public 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<String,M extends com.google.protobuf.Message>

process

public void process(String input,
                    Emitter<M> emitter)
Description copied from class: DoFn
Processes the records from a PCollection.

Note: Crunch can reuse a single input record object whose content changes on each DoFn.process(Object, Emitter) method call. This functionality is imposed by Hadoop's Reducer implementation: The framework will reuse the key and value objects that are passed into the reduce, therefore the application should clone the objects they want to keep a copy of.

Specified by:
process in class DoFn<String,M extends com.google.protobuf.Message>
Parameters:
input - The input record.
emitter - The emitter to send the output to


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