public abstract class SinkTap<Config,Output> extends Tap<Config,Void,Output>
Tap
instances may only be sinks (as opposed
to being a source). These types may subclass SinkTap for convenience or
set isSource()
to false
in a custom Tap sub-class.Modifier | Constructor and Description |
---|---|
protected |
SinkTap() |
protected |
SinkTap(Scheme<Config,?,Output,?,?> scheme) |
protected |
SinkTap(Scheme<Config,?,Output,?,?> scheme,
SinkMode sinkMode) |
Modifier and Type | Method and Description |
---|---|
Fields |
getSourceFields()
Method getSourceFields returns the sourceFields of this Tap object.
|
boolean |
isSource()
Method isSource returns true if this Tap instance can be used as a source.
|
TupleEntryIterator |
openForRead(FlowProcess<? extends Config> flowProcess,
Void input)
Method openForRead opens the resource represented by this Tap instance for reading.
|
boolean |
prepareResourceForRead(Config conf)
Method prepareResourceForRead allows the underlying resource to be notified when reading will begin.
|
void |
sourceConfInit(FlowProcess<? extends Config> flowProcess,
Config conf)
Method sourceConfInit initializes this instance as a source.
|
commitResource, createResource, createResource, deleteResource, deleteResource, equals, flowConfInit, getConfigDef, getFullIdentifier, getFullIdentifier, getIdentifier, getModifiedTime, getModifiedTime, getNodeConfigDef, getScheme, getSinkFields, getSinkMode, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasNodeConfigDef, hasStepConfigDef, id, isKeep, isReplace, isSink, isTemporary, isUpdate, openForRead, openForWrite, openForWrite, outgoingScopeFor, prepareResourceForWrite, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, resourceExists, retrieveSinkFields, retrieveSourceFields, rollbackResource, setScheme, sinkConfInit, taps, toString
protected SinkTap()
public Fields getSourceFields()
Tap
getSourceFields
in class Tap<Config,Void,Output>
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 Tap<Config,Void,Output>
conf
- of type ConfigIOException
public boolean isSource()
Tap
public void sourceConfInit(FlowProcess<? extends Config> flowProcess, Config conf)
Tap
Flow
instance or if it participates in multiple times in a given Flow or across different Flows in
a Cascade
.
In the context of a Flow, it will be called after
FlowListener.onStarting(cascading.flow.Flow)
Note that no resources or services should be modified by this method.sourceConfInit
in class Tap<Config,Void,Output>
flowProcess
- of type FlowProcessconf
- of type Configpublic TupleEntryIterator openForRead(FlowProcess<? extends Config> flowProcess, Void input) throws IOException
Tap
input
value may be null, if so, sub-classes must inquire with the underlying Scheme
via Scheme.sourceConfInit(cascading.flow.FlowProcess, Tap, Object)
to get the proper
input type and instantiate it before calling super.openForRead()
.
Note the returned iterator will return the same instance of TupleEntry
on every call,
thus a copy must be made of either the TupleEntry or the underlying Tuple
instance if they are to be
stored in a Collection.openForRead
in class Tap<Config,Void,Output>
flowProcess
- of type FlowProcessinput
- of type InputIOException
- when the resource cannot be openedCopyright © 2007-2015 Concurrent, Inc. All Rights Reserved.