|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.tap.Tap
cascading.tap.SinkTap
cascading.tap.TemplateTap
public class TemplateTap
Class TemplateTap can be used to write tuple streams out to subdirectories based on the values in the Tuple
instance.
Hfs Tap and a Formatter format syntax String. This allows
Tuple values at given positions to be used as directory names. Note that Hadoop can only sink to directories, and
all files in those directories are "part-xxxxx" files.
| Nested Class Summary | |
|---|---|
static class |
TemplateTap.TemplateScheme
|
| Constructor Summary | |
|---|---|
TemplateTap(Hfs parent,
String pathTemplate)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
TemplateTap(Hfs parent,
String pathTemplate,
SinkMode sinkMode)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
TemplateTap(Hfs parent,
String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete)
Constructor TemplateTap creates a new TemplateTap instance using the given parent Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String. |
|
| Method Summary | |
|---|---|
boolean |
deletePath(JobConf conf)
Method deletePath deletes the resource represented by this instance. |
boolean |
equals(Object object)
|
Tap |
getParent()
Method getParent returns the parent Tap of this TemplateTap object. |
Path |
getPath()
Method getPath returns the Hadoop path to the resource represented by this Tap instance. |
long |
getPathModified(JobConf conf)
Method getPathModified returns the date this resource was last modified. |
String |
getPathTemplate()
Method getPathTemplate returns the pathTemplate Formatter format String of this TemplateTap object. |
int |
hashCode()
|
boolean |
isWriteDirect()
Method isWriteDirect returns true if this instances TupleEntryCollector should be used to sink values. |
boolean |
makeDirs(JobConf conf)
Method makeDirs makes all the directories this Tap instance represents. |
TupleEntryCollector |
openForWrite(JobConf conf)
Method openForWrite opens the resource represented by this Tap instance. |
boolean |
pathExists(JobConf conf)
Method pathExists return true if the path represented by this instance exists. |
String |
toString()
|
| Methods inherited from class cascading.tap.SinkTap |
|---|
getSourceFields, isSource, openForRead, source, sourceInit |
| Methods inherited from class cascading.tap.Tap |
|---|
flowInit, getQualifiedPath, getScheme, getSinkFields, isAppend, isKeep, isReplace, isSink, outgoingScopeFor, resolveFields, resolveIncomingOperationFields, setScheme, setWriteDirect, sink, sinkInit, taps |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateTap(Hfs parent,
String pathTemplate)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
parent - of type TappathTemplate - of type String
public TemplateTap(Hfs parent,
String pathTemplate,
SinkMode sinkMode)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
parent - of type TappathTemplate - of type StringsinkMode - of type SinkMode
public TemplateTap(Hfs parent,
String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
keepParentOnDelete, when set to true, prevents the parent Tap from being deleted when #deletePath(org.apache.hadoop.mapred.JobConf)
is called, typically an issue when used inside a Cascade.
parent - of type TappathTemplate - of type StringsinkMode - of type SinkModekeepParentOnDelete - of type boolean
public TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.
This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing
data not in the result file to be used in the template path name.
parent - of type TappathTemplate - of type StringpathFields - of type Fields
public TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.
This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing
data not in the result file to be used in the template path name.
parent - of type TappathTemplate - of type StringpathFields - of type FieldssinkMode - of type SinkMode
public TemplateTap(Hfs parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete)
Hfs Tap as the
base path and default Scheme, and the pathTemplate as the Formatter format String.
The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.
This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing
data not in the result file to be used in the template path name.
keepParentOnDelete, when set to true, prevents the parent Tap from being deleted when #deletePath(org.apache.hadoop.mapred.JobConf)
is called, typically an issue when used inside a Cascade.
parent - of type TappathTemplate - of type StringpathFields - of type FieldssinkMode - of type SinkModekeepParentOnDelete - of type boolean| Method Detail |
|---|
public Tap getParent()
public String getPathTemplate()
Formatter format String of this TemplateTap object.
public boolean isWriteDirect()
TapTupleEntryCollector should be used to sink values.
isWriteDirect in class Tappublic Path getPath()
Tap
getPath in class TapTap.getPath()
public TupleEntryCollector openForWrite(JobConf conf)
throws IOException
Tap
openForWrite in class SinkTapconf - of type JobConf
IOException - when
public boolean makeDirs(JobConf conf)
throws IOException
Tap
makeDirs in class Tapconf - of type JobConf
IOException - when there is an error making directoriesTap.makeDirs(JobConf)
public boolean deletePath(JobConf conf)
throws IOException
Tap
deletePath in class Tapconf - of type JobConf
IOException - when the resource cannot be deletedTap.deletePath(JobConf)
public boolean pathExists(JobConf conf)
throws IOException
Tap
pathExists in class Tapconf - of type JobConf
IOException - when the status cannot be determinedTap.pathExists(JobConf)
public long getPathModified(JobConf conf)
throws IOException
Tap
getPathModified in class Tapconf - of type JobConf
IOException - when the modified date cannot be determinedTap.getPathModified(JobConf)public boolean equals(Object object)
equals in class Tappublic int hashCode()
hashCode in class Tappublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||