public abstract class BaseTemplateTap<Config,Output> extends SinkTap<Config,Output>
Modifier and Type | Class and Description |
---|---|
static class |
BaseTemplateTap.Counters |
static class |
BaseTemplateTap.TemplateScheme<Config,Output> |
Modifier and Type | Field and Description |
---|---|
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 java.lang.String |
pathTemplate
Field pathTemplate
|
Modifier | Constructor and Description |
---|---|
protected |
BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme) |
protected |
BaseTemplateTap(Scheme<Config,?,Output,?,?> scheme,
SinkMode sinkMode) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
Fields pathFields,
int openTapsThreshold) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
Fields pathFields,
SinkMode sinkMode) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
int openTapsThreshold) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
SinkMode sinkMode) |
protected |
BaseTemplateTap(Tap parent,
java.lang.String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold) |
Modifier and Type | Method and Description |
---|---|
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,
java.lang.String path) |
boolean |
deleteResource(Config conf)
Method deleteResource deletes the resource represented by this instance.
|
boolean |
equals(java.lang.Object object) |
java.lang.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.
|
java.lang.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 |
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.
|
java.lang.String |
toString() |
getSourceFields, isSource, openForRead, sourceConfInit
createResource, deleteResource, flowConfInit, getConfigDef, getFullIdentifier, getFullIdentifier, getModifiedTime, getScheme, getSinkFields, getSinkMode, getStepConfigDef, getTrace, hasConfigDef, hasStepConfigDef, id, isEquivalentTo, isKeep, isReplace, isSink, isTemporary, isUpdate, openForRead, openForWrite, outgoingScopeFor, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, retrieveSinkFields, retrieveSourceFields, setScheme, sinkConfInit, taps
protected static final int OPEN_TAPS_THRESHOLD_DEFAULT
protected Tap parent
protected java.lang.String pathTemplate
protected boolean keepParentOnDelete
protected int openTapsThreshold
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, SinkMode sinkMode)
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, Fields pathFields, int openTapsThreshold)
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, Fields pathFields, SinkMode sinkMode)
protected BaseTemplateTap(Tap parent, java.lang.String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
protected abstract TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<Config> flowProcess, Tap parent, java.lang.String path) throws java.io.IOException
java.io.IOException
public Tap getParent()
public java.lang.String getPathTemplate()
Formatter
format String of this TemplateTap object.public java.lang.String getIdentifier()
Tap
getIdentifier
in class Tap<Config,java.lang.Void,Output>
public int getOpenTapsThreshold()
public TupleEntryCollector openForWrite(FlowProcess<Config> flowProcess, Output output) throws java.io.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,java.lang.Void,Output>
flowProcess
- of type FlowProcessoutput
- of type Outputjava.io.IOException
- when the resource cannot be openedpublic boolean createResource(Config conf) throws java.io.IOException
Tap
createResource
in class Tap<Config,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
- when there is an error making directoriesTap.createResource(Object)
public boolean deleteResource(Config conf) throws java.io.IOException
Tap
deleteResource
in class Tap<Config,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
- when the resource cannot be deletedTap.deleteResource(Object)
public boolean commitResource(Config conf) throws java.io.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,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
public boolean rollbackResource(Config conf) throws java.io.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,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
public boolean resourceExists(Config conf) throws java.io.IOException
Tap
resourceExists
in class Tap<Config,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
- when the status cannot be determinedTap.resourceExists(Object)
public long getModifiedTime(Config conf) throws java.io.IOException
Tap
getModifiedTime
in class Tap<Config,java.lang.Void,Output>
conf
- of type Configjava.io.IOException
Tap.getModifiedTime(Object)
public boolean equals(java.lang.Object object)