|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.crunch.io.impl.TableSourceTargetImpl<K,V>
public class TableSourceTargetImpl<K,V>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.crunch.Target |
|---|
Target.WriteMode |
| Field Summary | |
|---|---|
protected Source<T> |
source
|
protected Target |
target
|
| Constructor Summary | |
|---|---|
TableSourceTargetImpl(TableSource<K,V> source,
Target target)
|
|
| Method Summary | ||
|---|---|---|
boolean |
accept(OutputHandler handler,
PType<?> ptype)
Checks to see if this Target instance is compatible with the
given PType. |
|
|
asSourceTarget(PType<S> ptype)
Attempt to create the SourceTarget type that corresponds to this Target
for the given PType, if possible. |
|
SourceTarget<T> |
conf(String key,
String value)
Adds the given key-value pair to the Configuration instance(s) that are used to
read and write this SourceTarget<T>. |
|
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)
|
|
Converter<?,?,?,?> |
getConverter()
Returns the Converter used for mapping the inputs from this instance
into PCollection or PTable values. |
|
Converter<?,?,?,?> |
getConverter(PType<?> ptype)
Returns the Converter to use for mapping from the output PCollection
into the output values expected by this instance. |
|
long |
getLastModifiedAt(org.apache.hadoop.conf.Configuration configuration)
Returns the time (in milliseconds) that this Source was most recently
modified (e.g., because an input file was edited or new files were added to
a directory.) |
|
long |
getSize(org.apache.hadoop.conf.Configuration configuration)
Returns the number of bytes in this Source. |
|
PTableType<K,V> |
getTableType()
|
|
PType<T> |
getType()
Returns the PType for this source. |
|
boolean |
handleExisting(Target.WriteMode strategy,
long lastModifiedAt,
org.apache.hadoop.conf.Configuration conf)
Apply the given WriteMode to this Target instance. |
|
int |
hashCode()
|
|
Source<T> |
inputConf(String key,
String value)
Adds the given key-value pair to the Configuration instance that is used to read
this Source<T></T>. |
|
Target |
outputConf(String key,
String value)
Adds the given key-value pair to the Configuration instance that is used to write
this Target. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.crunch.Source |
|---|
configureSource, getConverter, getLastModifiedAt, getSize, getType, inputConf |
| Field Detail |
|---|
protected final Source<T> source
protected final Target target
| Constructor Detail |
|---|
public TableSourceTargetImpl(TableSource<K,V> source,
Target target)
| Method Detail |
|---|
public PTableType<K,V> getTableType()
getTableType in interface TableSource<K,V>
public Source<T> inputConf(String key,
String value)
SourceConfiguration instance that is used to read
this Source<T></T>. Allows for multiple inputs to re-use the same config keys with
different values when necessary.
inputConf in interface Source<T>public PType<T> getType()
SourcePType for this source.
getType in interface Source<T>
public void configureSource(org.apache.hadoop.mapreduce.Job job,
int inputId)
throws IOException
Source
configureSource in interface Source<T>job - The job to configureinputId - For a multi-input job, an identifier for this input to the job
IOExceptionpublic long getSize(org.apache.hadoop.conf.Configuration configuration)
SourceSource.
getSize in interface Source<T>
public boolean accept(OutputHandler handler,
PType<?> ptype)
TargetTarget instance is compatible with the
given PType.
accept in interface Targethandler - The OutputHandler that is managing the output for the jobptype - The PType to check
PType,
false otherwisepublic <S> SourceTarget<S> asSourceTarget(PType<S> ptype)
TargetSourceTarget type that corresponds to this Target
for the given PType, if possible. If it is not possible, return null.
asSourceTarget in interface Targetptype - The PType to use in constructing the SourceTarget
SourceTarget or null if such a SourceTarget does not existpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
public Target outputConf(String key,
String value)
TargetConfiguration instance that is used to write
this Target. Allows for multiple target outputs to re-use the same config keys with
different values when necessary.
outputConf in interface Target
public boolean handleExisting(Target.WriteMode strategy,
long lastModifiedAt,
org.apache.hadoop.conf.Configuration conf)
TargetWriteMode to this Target instance.
handleExisting in interface Targetstrategy - The strategy for handling existing outputsconf - The ever-useful Configuration instance
public long getLastModifiedAt(org.apache.hadoop.conf.Configuration configuration)
SourceSource was most recently
modified (e.g., because an input file was edited or new files were added to
a directory.)
getLastModifiedAt in interface Source<T>public Converter<?,?,?,?> getConverter()
SourceConverter used for mapping the inputs from this instance
into PCollection or PTable values.
getConverter in interface Source<T>public Converter<?,?,?,?> getConverter(PType<?> ptype)
TargetConverter to use for mapping from the output PCollection
into the output values expected by this instance.
getConverter in interface Targetptype - The PType of the data that is being written to this instance
Converter for the output represented by this instance
public SourceTarget<T> conf(String key,
String value)
SourceTargetConfiguration instance(s) that are used to
read and write this SourceTarget<T>. Allows for multiple inputs and outputs to
re-use the same config keys with different values when necessary.
conf in interface SourceTarget<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||