public interface Target
Target
represents the output destination of a Crunch PCollection
in the context of a Crunch job.Modifier and Type | Interface and Description |
---|---|
static class |
Target.WriteMode
An enum to represent different options the client may specify
for handling the case where the output path, table, etc.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(OutputHandler handler,
PType<?> ptype)
Checks to see if this
Target instance is compatible with the
given PType . |
<T> SourceTarget<T> |
asSourceTarget(PType<T> ptype)
Attempt to create the
SourceTarget type that corresponds to this Target
for the given PType , if possible. |
Converter<?,?,?,?> |
getConverter(PType<?> ptype)
Returns the
Converter to use for mapping from the output PCollection
into the output values expected by this instance. |
boolean |
handleExisting(Target.WriteMode writeMode,
long lastModifiedAt,
org.apache.hadoop.conf.Configuration conf)
Apply the given
WriteMode to this Target instance. |
Target |
outputConf(String key,
String value)
Adds the given key-value pair to the
Configuration instance that is used to write
this Target . |
Target outputConf(String key, String value)
Configuration
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.boolean handleExisting(Target.WriteMode writeMode, long lastModifiedAt, org.apache.hadoop.conf.Configuration conf)
WriteMode
to this Target
instance.writeMode
- The strategy for handling existing outputslastModifiedAt
- the time of the most recent modification to one of the source inputs for handling based
on the provided writeMode
.conf
- The ever-useful Configuration
instanceboolean accept(OutputHandler handler, PType<?> ptype)
Target
instance is compatible with the
given PType
.handler
- The OutputHandler
that is managing the output for the jobptype
- The PType
to checkPType
,
false otherwiseConverter<?,?,?,?> getConverter(PType<?> ptype)
Converter
to use for mapping from the output PCollection
into the output values expected by this instance.ptype
- The PType
of the data that is being written to this instanceConverter
for the output represented by this instance<T> SourceTarget<T> asSourceTarget(PType<T> ptype)
SourceTarget
type that corresponds to this Target
for the given PType
, if possible. If it is not possible, return null
.ptype
- The PType
to use in constructing the SourceTarget
SourceTarget
or null if such a SourceTarget
does not existCopyright © 2016 The Apache Software Foundation. All rights reserved.