com.cloudera.crunch.io.impl
Class SourceTargetImpl<T>

java.lang.Object
  extended by com.cloudera.crunch.io.impl.SourceTargetImpl<T>
All Implemented Interfaces:
Source<T>, SourceTarget<T>, Target
Direct Known Subclasses:
ReadableSourceTargetImpl, SourcePathTargetImpl, TableSourceTargetImpl

public class SourceTargetImpl<T>
extends Object
implements SourceTarget<T>


Field Summary
protected  Source<T> source
           
protected  Target target
           
 
Constructor Summary
SourceTargetImpl(Source<T> source, Target target)
           
 
Method Summary
 boolean accept(OutputHandler handler, PType<?> ptype)
           
<S> SourceTarget<S>
asSourceTarget(PType<S> ptype)
           
 void configureSource(org.apache.hadoop.mapreduce.Job job, int inputId)
          Configure the given job to use this source as an input.
 boolean equals(Object other)
           
 long getSize(org.apache.hadoop.conf.Configuration configuration)
          Returns the number of bytes in this Source.
 PType<T> getType()
          Returns the PType for this source.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected final Source<T> source

target

protected final Target target
Constructor Detail

SourceTargetImpl

public SourceTargetImpl(Source<T> source,
                        Target target)
Method Detail

getType

public PType<T> getType()
Description copied from interface: Source
Returns the PType for this source.

Specified by:
getType in interface Source<T>

configureSource

public void configureSource(org.apache.hadoop.mapreduce.Job job,
                            int inputId)
                     throws IOException
Description copied from interface: Source
Configure the given job to use this source as an input.

Specified by:
configureSource in interface Source<T>
Parameters:
job - The job to configure
inputId - For a multi-input job, an identifier for this input to the job
Throws:
IOException

getSize

public long getSize(org.apache.hadoop.conf.Configuration configuration)
Description copied from interface: Source
Returns the number of bytes in this Source.

Specified by:
getSize in interface Source<T>

accept

public boolean accept(OutputHandler handler,
                      PType<?> ptype)
Specified by:
accept in interface Target

asSourceTarget

public <S> SourceTarget<S> asSourceTarget(PType<S> ptype)
Specified by:
asSourceTarget in interface Target

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.