This project has retired. For details please refer to its
Attic page.
TrevniKeyTarget (Apache Crunch 0.9.0 API)
org.apache.crunch.io.avro.trevni
Class TrevniKeyTarget
java.lang.Object
org.apache.crunch.io.impl.FileTargetImpl
org.apache.crunch.io.avro.trevni.TrevniKeyTarget
- All Implemented Interfaces:
- MapReduceTarget, PathTarget, Target
public class TrevniKeyTarget
- extends FileTargetImpl
Method Summary |
boolean |
accept(OutputHandler handler,
PType<?> ptype)
Checks to see if this Target instance is compatible with the
given PType . |
|
asSourceTarget(PType<T> ptype)
Attempt to create the SourceTarget type that corresponds to this Target
for the given PType , if possible. |
void |
configureForMapReduce(org.apache.hadoop.mapreduce.Job job,
PType<?> ptype,
org.apache.hadoop.fs.Path outputPath,
String name)
|
protected org.apache.hadoop.fs.Path |
getDestFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dir,
boolean mapOnlyJob)
|
protected org.apache.hadoop.fs.Path |
getSourcePattern(org.apache.hadoop.fs.Path workingPath,
int index)
|
String |
toString()
|
Methods inherited from class org.apache.crunch.io.impl.FileTargetImpl |
configureForMapReduce, configureForMapReduce, equals, extractPartitionNumber, getConverter, getFileNamingScheme, getPath, getSuccessIndicator, handleExisting, handleOutputs, hashCode, isCompatible, outputConf |
TrevniKeyTarget
public TrevniKeyTarget(String path)
TrevniKeyTarget
public TrevniKeyTarget(org.apache.hadoop.fs.Path path)
TrevniKeyTarget
public TrevniKeyTarget(org.apache.hadoop.fs.Path path,
FileNamingScheme fileNamingScheme)
toString
public String toString()
- Overrides:
toString
in class FileTargetImpl
accept
public boolean accept(OutputHandler handler,
PType<?> ptype)
- Description copied from interface:
Target
- Checks to see if this
Target
instance is compatible with the
given PType
.
- Specified by:
accept
in interface Target
- Overrides:
accept
in class FileTargetImpl
- Parameters:
handler
- The OutputHandler
that is managing the output for the jobptype
- The PType
to check
- Returns:
- True if this Target can write data in the form of the given
PType
,
false otherwise
configureForMapReduce
public void configureForMapReduce(org.apache.hadoop.mapreduce.Job job,
PType<?> ptype,
org.apache.hadoop.fs.Path outputPath,
String name)
- Specified by:
configureForMapReduce
in interface MapReduceTarget
- Overrides:
configureForMapReduce
in class FileTargetImpl
getSourcePattern
protected org.apache.hadoop.fs.Path getSourcePattern(org.apache.hadoop.fs.Path workingPath,
int index)
- Overrides:
getSourcePattern
in class FileTargetImpl
getDestFile
protected org.apache.hadoop.fs.Path getDestFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dir,
boolean mapOnlyJob)
throws IOException
- Overrides:
getDestFile
in class FileTargetImpl
- Throws:
IOException
asSourceTarget
public <T> SourceTarget<T> asSourceTarget(PType<T> ptype)
- Description copied from interface:
Target
- Attempt to create the
SourceTarget
type that corresponds to this Target
for the given PType
, if possible. If it is not possible, return null
.
- Specified by:
asSourceTarget
in interface Target
- Overrides:
asSourceTarget
in class FileTargetImpl
- Parameters:
ptype
- The PType
to use in constructing the SourceTarget
- Returns:
- A new
SourceTarget
or null if such a SourceTarget
does not exist
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.