|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.tap.Tap<Config,Void,Output> cascading.tap.SinkTap<Config,Output> cascading.tap.MultiSinkTap<Child,Config,Output>
public class MultiSinkTap<Child extends Tap,Config,Output>
Class MultiSinkTap is both a CompositeTap
and SinkTap
that can write to
multiple child Tap
instances simultaneously.
MultiSourceTap
.
Note all child Tap instances may or may not have the same declared Fields. In the case they do not, all
sink fields will be merged into a single Fields instance via Fields.merge(cascading.tuple.Fields...)
.
Constructor Summary | |
---|---|
MultiSinkTap(Child... taps)
Constructor MultiSinkTap creates a new MultiSinkTap instance. |
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. |
boolean |
equals(Object o)
|
Iterator<Child> |
getChildTaps()
|
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. |
long |
getNumChildTaps()
|
Scheme |
getScheme()
Method getScheme returns the scheme of this Tap object. |
protected Child[] |
getTaps()
|
int |
hashCode()
|
TupleEntryCollector |
openForWrite(FlowProcess<Config> flowProcess,
Output output)
Method openForWrite opens the resource represented by this Tap instance for writing. |
void |
presentSinkFields(FlowProcess<Config> flowProcess,
Fields fields)
|
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. |
void |
sinkConfInit(FlowProcess<Config> process,
Config conf)
Method sinkConfInit initializes this instance as a sink. |
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 |
Constructor Detail |
---|
@ConstructorProperties(value="taps") public MultiSinkTap(Child... taps)
taps
- of type Tap...Method Detail |
---|
protected Child[] getTaps()
public Iterator<Child> getChildTaps()
getChildTaps
in interface CompositeTap<Child extends Tap>
public long getNumChildTaps()
getNumChildTaps
in interface CompositeTap<Child extends Tap>
public String getIdentifier()
Tap
getIdentifier
in class Tap<Config,Void,Output>
public void presentSinkFields(FlowProcess<Config> flowProcess, Fields fields)
presentSinkFields
in class Tap<Config,Void,Output>
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 void sinkConfInit(FlowProcess<Config> process, Config conf)
Tap
Flow
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,Void,Output>
process
- of type FlowProcessconf
- of type Configpublic 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 directoriespublic boolean deleteResource(Config conf) throws IOException
Tap
deleteResource
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
- when the resource cannot be deletedpublic 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 determinedpublic long getModifiedTime(Config conf) throws IOException
Tap
getModifiedTime
in class Tap<Config,Void,Output>
conf
- of type Config
IOException
public Scheme getScheme()
Tap
getScheme
in class Tap<Config,Void,Output>
public String toString()
toString
in class Tap<Config,Void,Output>
public boolean equals(Object o)
equals
in class Tap<Config,Void,Output>
public int hashCode()
hashCode
in class Tap<Config,Void,Output>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |