|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crunch.io.To
public class To
Static factory methods for creating common Target
types.
The To
class is intended to be used as part of a literate API
for writing the output of Crunch pipelines to common file types. We can use
the Target
objects created by the factory methods in the To
class with either the write
method on the Pipeline
class or
the convenience write
method on PCollection
and PTable
instances.
Pipeline pipeline = new MRPipeline(this.getClass());
...
// Write a PCollection
Constructor Summary | |
---|---|
To()
|
Method Summary | ||
---|---|---|
static Target |
avroFile(org.apache.hadoop.fs.Path path)
Creates a Target at the given Path that writes data to
Avro files. |
|
static Target |
avroFile(String pathName)
Creates a Target at the given path name that writes data to
Avro files. |
|
static
|
formattedFile(org.apache.hadoop.fs.Path path,
Class<? extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>> formatClass)
Creates a Target at the given Path that writes data to
a custom FileOutputFormat . |
|
static
|
formattedFile(String pathName,
Class<? extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>> formatClass)
Creates a Target at the given path name that writes data to
a custom FileOutputFormat . |
|
static Target |
sequenceFile(org.apache.hadoop.fs.Path path)
Creates a Target at the given Path that writes data to
SequenceFiles. |
|
static Target |
sequenceFile(String pathName)
Creates a Target at the given path name that writes data to
SequenceFiles. |
|
static Target |
textFile(org.apache.hadoop.fs.Path path)
Creates a Target at the given Path that writes data to
text files. |
|
static Target |
textFile(String pathName)
Creates a Target at the given path name that writes data to
text files. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public To()
Method Detail |
---|
public static <K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable> Target formattedFile(String pathName, Class<? extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>> formatClass)
Target
at the given path name that writes data to
a custom FileOutputFormat
.
pathName
- The name of the path to write the data to on the filesystemformatClass
- The FileOutputFormat<K, V>
to write the data to
Target
instancepublic static <K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable> Target formattedFile(org.apache.hadoop.fs.Path path, Class<? extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>> formatClass)
Target
at the given Path
that writes data to
a custom FileOutputFormat
.
path
- The Path
to write the data toformatClass
- The FileOutputFormat
to write the data to
Target
instancepublic static Target avroFile(String pathName)
Target
at the given path name that writes data to
Avro files. The PType
for the written data must be for Avro records.
pathName
- The name of the path to write the data to on the filesystem
Target
instancepublic static Target avroFile(org.apache.hadoop.fs.Path path)
Target
at the given Path
that writes data to
Avro files. The PType
for the written data must be for Avro records.
path
- The Path
to write the data to
Target
instancepublic static Target sequenceFile(String pathName)
Target
at the given path name that writes data to
SequenceFiles.
pathName
- The name of the path to write the data to on the filesystem
Target
instancepublic static Target sequenceFile(org.apache.hadoop.fs.Path path)
Target
at the given Path
that writes data to
SequenceFiles.
path
- The Path
to write the data to
Target
instancepublic static Target textFile(String pathName)
Target
at the given path name that writes data to
text files.
pathName
- The name of the path to write the data to on the filesystem
Target
instancepublic static Target textFile(org.apache.hadoop.fs.Path path)
Target
at the given Path
that writes data to
text files.
path
- The Path
to write the data to
Target
instance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |