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

org.apache.crunch.util
Class DelegatingReadableData<S,T>

java.lang.Object
  extended by org.apache.crunch.util.DelegatingReadableData<S,T>
All Implemented Interfaces:
Serializable, ReadableData<T>

public class DelegatingReadableData<S,T>
extends Object
implements ReadableData<T>

Implements the ReadableData<T> interface by delegating to an ReadableData<S> instance and passing its contents through a DoFn<S, T>.

See Also:
Serialized Form

Constructor Summary
DelegatingReadableData(ReadableData<S> delegate, DoFn<S,T> fn)
           
 
Method Summary
 void configure(org.apache.hadoop.conf.Configuration conf)
          Allows this instance to specify any additional configuration settings that may be needed by the job that it is launched in.
 Set<SourceTarget<?>> getSourceTargets()
           
 Iterable<T> read(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,?,?> context)
          Read the data referenced by this instance within the given context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingReadableData

public DelegatingReadableData(ReadableData<S> delegate,
                              DoFn<S,T> fn)
Method Detail

getSourceTargets

public Set<SourceTarget<?>> getSourceTargets()
Specified by:
getSourceTargets in interface ReadableData<T>
Returns:
Any SourceTarget instances that must exist before the data in this instance can be read. Used by the planner in sequencing job processing.

configure

public void configure(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: ReadableData
Allows this instance to specify any additional configuration settings that may be needed by the job that it is launched in.

Specified by:
configure in interface ReadableData<T>
Parameters:
conf - The Configuration object for the job

read

public Iterable<T> read(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,?,?> context)
                 throws IOException
Description copied from interface: ReadableData
Read the data referenced by this instance within the given context.

Specified by:
read in interface ReadableData<T>
Parameters:
context - The context of the task that is reading the data
Returns:
An iterable reference to the data in this instance
Throws:
IOException - If the data cannot be read


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