|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.tap.Tap<Config,Input,Void>
cascading.tap.SourceTap<Config,Input>
public abstract class SourceTap<Config,Input>
Class SourceTap is an optional base class for source only Taps.
SomeTap instances may only be sources (as opposed
to being a sink). These types should subclass SourceTap for convenience or
set isSink() to false in a custom Tap sub-class.
| Constructor Summary | |
|---|---|
protected |
SourceTap()
|
protected |
SourceTap(Scheme<Config,Input,?,?,?> scheme)
|
| 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. |
boolean |
deleteResource(Config conf)
Method deleteResource deletes the resource represented by this instance. |
Fields |
getSinkFields()
Method getSinkFields returns the sinkFields of this Tap object. |
boolean |
isSink()
Method isSink returns true if this Tap instance can be used as a sink. |
TupleEntryCollector |
openForWrite(FlowProcess<Config> flowProcess,
Void output)
Method openForWrite opens the resource represented by this Tap instance for writing. |
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. |
void |
sinkConfInit(FlowProcess<Config> flowProcess,
Config conf)
Method sinkConfInit initializes this instance as a sink. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected SourceTap()
protected SourceTap(Scheme<Config,Input,?,?,?> scheme)
| Method Detail |
|---|
public Fields getSinkFields()
Tap
getSinkFields in class Tap<Config,Input,Void>public final boolean isSink()
Tap
isSink in class Tap<Config,Input,Void>
public boolean deleteResource(Config conf)
throws IOException
Tap
deleteResource in class Tap<Config,Input,Void>conf - of type Config
IOException - when the resource cannot be deleted
public void sinkConfInit(FlowProcess<Config> flowProcess,
Config conf)
TapFlow
instance or if it participates in multiple times in a given Flow or across different Flows in
a Cascade.
Note this method will be called in context of this Tap being used as a traditional 'sink' and as a 'trap'.
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. If this Tap instance returns true for
Tap.isReplace(), then Tap.deleteResource(Object) will be called by the parent Flow.
sinkConfInit in class Tap<Config,Input,Void>flowProcess - of type FlowProcessconf - of type Config
public boolean createResource(Config conf)
throws IOException
Tap
createResource in class Tap<Config,Input,Void>conf - of type Config
IOException - when there is an error making directories
public boolean commitResource(Config conf)
throws IOException
TapTap.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,Input,Void>conf - of type Config
IOException
public boolean rollbackResource(Config conf)
throws IOException
TapTap.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,Input,Void>conf - of type Config
IOException
public TupleEntryCollector openForWrite(FlowProcess<Config> flowProcess,
Void output)
throws IOException
TapSinkMode 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,Input,Void>flowProcess - of type FlowProcessoutput - of type Output
IOException - when the resource cannot be opened
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||