|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.tap.Tap<Config,Input,Void> cascading.tap.SourceTap<Config,Input> cascading.tap.MultiSourceTap<Child,Config,Input>
public class MultiSourceTap<Child extends Tap,Config,Input>
Class MultiSourceTap is used to tie multiple Tap
instances into a single resource. Effectively this will allow
multiple files to be concatenated into the requesting pipe assembly, if they all share the same Scheme
instance.
TextLine
), they may not contain
the same semi-structure internally. For example, one file might be an Apache log file, and another might be a Log4J
log file. If each one should be parsed differently, then they must be handled by different pipe assembly branches.
Field Summary | |
---|---|
protected Child[] |
taps
|
Constructor Summary | |
---|---|
|
MultiSourceTap(Child... taps)
Constructor MultiSourceTap creates a new MultiSourceTap instance. |
protected |
MultiSourceTap(Scheme<Config,Input,?,?,?> scheme)
|
Method Summary | |
---|---|
boolean |
equals(Object object)
|
Iterator<Child> |
getChildTaps()
|
String |
getIdentifier()
Method getIdentifier returns a String representing the resource this Tap instance represents. |
long |
getModifiedTime(Config conf)
Returns the most current modified time. |
long |
getNumChildTaps()
|
Scheme |
getScheme()
Method getScheme returns the scheme of this Tap object. |
protected Child[] |
getTaps()
Method getTaps returns the taps of this MultiTap object. |
int |
hashCode()
|
boolean |
isReplace()
Method isReplace indicates whether the resource represented by this instance should be deleted if it already exists when the Flow is started. |
TupleEntryIterator |
openForRead(FlowProcess<Config> flowProcess,
Input input)
Method openForRead opens the resource represented by this Tap instance for reading. |
boolean |
resourceExists(Config conf)
Method resourceExists returns true if the path represented by this instance exists. |
void |
sourceConfInit(FlowProcess<Config> process,
Config conf)
Method sourceConfInit initializes this instance as a source. |
String |
toString()
|
Methods inherited from class cascading.tap.SourceTap |
---|
commitResource, createResource, deleteResource, getSinkFields, isSink, openForWrite, rollbackResource, sinkConfInit |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Child extends Tap[] taps
Constructor Detail |
---|
protected MultiSourceTap(Scheme<Config,Input,?,?,?> scheme)
@ConstructorProperties(value="taps") public MultiSourceTap(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,Input,Void>
public Scheme getScheme()
Tap
getScheme
in class Tap<Config,Input,Void>
public boolean isReplace()
Tap
isReplace
in class Tap<Config,Input,Void>
public void sourceConfInit(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
.
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,Input,Void>
process
- of type FlowProcessconf
- of type Configpublic boolean resourceExists(Config conf) throws IOException
Tap
resourceExists
in class Tap<Config,Input,Void>
conf
- of type Config
IOException
- when the status cannot be determinedpublic long getModifiedTime(Config conf) throws IOException
getModifiedTime
in class Tap<Config,Input,Void>
conf
- of type Config
IOException
public TupleEntryIterator openForRead(FlowProcess<Config> flowProcess, Input 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,Input,Void>
flowProcess
- of type FlowProcessinput
- of type Input
IOException
- when the resource cannot be openedpublic boolean equals(Object object)
equals
in class Tap<Config,Input,Void>
public int hashCode()
hashCode
in class Tap<Config,Input,Void>
public String toString()
toString
in class Tap<Config,Input,Void>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |