|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcascading.tap.Tap<Config,Void,Output>
cascading.tap.SinkTap<Config,Output>
cascading.tap.BaseTemplateTap<Config,Output>
public abstract class BaseTemplateTap<Config,Output>
Nested Class Summary | |
---|---|
static class |
BaseTemplateTap.Counters
|
static class |
BaseTemplateTap.TemplateScheme<Config,Output>
|
Field Summary | |
---|---|
protected boolean |
keepParentOnDelete
Field keepParentOnDelete |
protected static int |
OPEN_TAPS_THRESHOLD_DEFAULT
Field OPEN_FILES_THRESHOLD_DEFAULT |
protected int |
openTapsThreshold
Field openTapsThreshold |
protected Tap |
parent
Field parent |
protected String |
pathTemplate
Field pathTemplate |
Constructor Summary | |
---|---|
protected |
BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme)
|
protected |
BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme,
SinkMode sinkMode)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
Fields pathFields,
int openTapsThreshold)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
int openTapsThreshold)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
SinkMode sinkMode)
|
protected |
BaseTemplateTap(Tap parent,
String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold)
|
Method Summary | |
---|---|
boolean |
commitResource(Config conf)
Method commitResource allows the underlying resource to be notified when all write processing is successful so that any additional cleanup or processing may be completed. |
boolean |
createResource(Config conf)
Method createResource creates the underlying resource. |
protected abstract TupleEntrySchemeCollector |
createTupleEntrySchemeCollector(FlowProcess<Config> flowProcess,
Tap parent,
String path)
|
boolean |
deleteResource(Config conf)
Method deleteResource deletes the resource represented by this instance. |
boolean |
equals(Object object)
|
String |
getIdentifier()
Method getIdentifier returns a String representing the resource this Tap instance represents. |
long |
getModifiedTime(Config conf)
Method getModifiedTime returns the date this resource was last modified. |
int |
getOpenTapsThreshold()
Method getOpenTapsThreshold returns the openTapsThreshold of this TemplateTap object. |
Tap |
getParent()
Method getParent returns the parent Tap of this TemplateTap object. |
String |
getPathTemplate()
Method getPathTemplate returns the pathTemplate Formatter format String of this TemplateTap object. |
int |
hashCode()
|
TupleEntryCollector |
openForWrite(FlowProcess<Config> flowProcess,
Output output)
Method openForWrite opens the resource represented by this Tap instance for writing. |
boolean |
prepareResourceForRead(Config conf)
Method prepareResourceForRead allows the underlying resource to be notified when reading will begin. |
boolean |
prepareResourceForWrite(Config conf)
Method prepareResourceForWrite allows the underlying resource to be notified when writing will begin. |
boolean |
resourceExists(Config conf)
Method resourceExists returns true if the path represented by this instance exists. |
boolean |
rollbackResource(Config conf)
Method rollbackResource allows the underlying resource to be notified when any write processing has failed or was stopped so that any cleanup may be started. |
String |
toString()
|
Methods inherited from class cascading.tap.SinkTap |
---|
getSourceFields, isSource, openForRead, sourceConfInit |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int OPEN_TAPS_THRESHOLD_DEFAULT
protected Tap parent
protected String pathTemplate
protected boolean keepParentOnDelete
protected int openTapsThreshold
Constructor Detail |
---|
protected BaseTemplateTap(Tap parent, String pathTemplate, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, String pathTemplate, SinkMode sinkMode)
protected BaseTemplateTap(Tap parent, String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, String pathTemplate, Fields pathFields, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, String pathTemplate, Fields pathFields, SinkMode sinkMode)
protected BaseTemplateTap(Tap parent, String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
protected BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme, SinkMode sinkMode)
protected BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme)
Method Detail |
---|
protected abstract TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<Config> flowProcess, Tap parent, String path) throws IOException
IOException
public Tap getParent()
public String getPathTemplate()
Formatter
format String of this TemplateTap object.
public String getIdentifier()
Tap
getIdentifier
in class Tap<Config,Void,Output>
public int getOpenTapsThreshold()
public TupleEntryCollector openForWrite(FlowProcess<Config> flowProcess, Output output) throws IOException
Tap
SinkMode
setting. If SinkMode is
SinkMode.REPLACE
, this call may fail. See Tap.openForWrite(cascading.flow.FlowProcess)
.
output
value may be null, if so, sub-classes must inquire with the underlying Scheme
via Scheme.sinkConfInit(cascading.flow.FlowProcess, Tap, Object)
to get the proper
output type and instantiate it before calling super.openForWrite()
.
openForWrite
in class Tap<Config,Void,Output>
flowProcess
- of type FlowProcessoutput
- of type Output
IOException
- when the resource cannot be openedpublic boolean createResource(Config conf) throws IOException
Tap
createResource
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
- when there is an error making directoriesTap.createResource(Object)
public boolean deleteResource(Config conf) throws IOException
Tap
deleteResource
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
- when the resource cannot be deletedTap.deleteResource(Object)
public boolean prepareResourceForRead(Config conf) throws IOException
Tap
false
, an exception will be thrown halting the current Flow.
In most cases, resource initialization should happen in the Tap.openForRead(FlowProcess, Object)
method.
This allows for initialization of cluster side resources, like a JDBC driver used to read data from a database,
that cannot be passed client to cluster.
prepareResourceForRead
in class SinkTap<Config,Output>
conf
- of type Config
IOException
public boolean prepareResourceForWrite(Config conf) throws IOException
Tap
false
, an exception will be thrown halting the current Flow.
In most cases, resource initialization should happen in the Tap.openForWrite(FlowProcess, Object)
method.
This allows for initialization of cluster side resources, like a JDBC driver used to write data to a database,
that cannot be passed client to cluster.
In the above JDBC example, overriding this method will allow for testing for the existence of and/or creating
a remote table used by all individual cluster side tasks.
prepareResourceForWrite
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
public boolean commitResource(Config conf) throws IOException
Tap
Tap.rollbackResource(Object)
to handle cleanup in the face of failures.
This method is invoked once client side and not in the cluster, if any.
If other sink Tap instance in a given Flow fail on commitResource after called on this instance,
rollbackResource will not be called.
commitResource
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
public boolean rollbackResource(Config conf) throws IOException
Tap
Tap.commitResource(Object)
to handle cleanup when the write has successfully completed.
This method is invoked once client side and not in the cluster, if any.
rollbackResource
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
public boolean resourceExists(Config conf) throws IOException
Tap
resourceExists
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
- when the status cannot be determinedTap.resourceExists(Object)
public long getModifiedTime(Config conf) throws IOException
Tap
getModifiedTime
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
Tap.getModifiedTime(Object)
public boolean equals(Object object)
equals
in class Tap<Config,Void,Output>
public int hashCode()
hashCode
in class Tap<Config,Void,Output>
public String toString()
toString
in class Tap<Config,Void,Output>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |