|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.tap.Tap<Config,Input,Output> cascading.tap.partition.BasePartitionTap<Config,Input,Output>
public abstract class BasePartitionTap<Config,Input,Output>
Nested Class Summary | |
---|---|
static class |
BasePartitionTap.Counters
|
class |
BasePartitionTap.PartitionCollector
|
static class |
BasePartitionTap.PartitionScheme<Config,Input,Output>
|
Field Summary | |
---|---|
protected boolean |
keepParentOnDelete
Field keepParentOnDelete |
protected static int |
OPEN_WRITES_THRESHOLD_DEFAULT
Field OPEN_FILES_THRESHOLD_DEFAULT |
protected int |
openWritesThreshold
Field openTapsThreshold |
protected Tap |
parent
Field parent |
protected Partition |
partition
Field partition |
Constructor Summary | |
---|---|
protected |
BasePartitionTap(Tap parent,
Partition partition,
int openWritesThreshold)
|
protected |
BasePartitionTap(Tap parent,
Partition partition,
SinkMode sinkMode)
|
protected |
BasePartitionTap(Tap parent,
Partition partition,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openWritesThreshold)
|
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. |
protected abstract TupleEntrySchemeCollector |
createTupleEntrySchemeCollector(FlowProcess<Config> flowProcess,
Tap parent,
String path,
long sequence)
|
protected abstract TupleEntrySchemeIterator |
createTupleEntrySchemeIterator(FlowProcess<Config> flowProcess,
Tap parent,
String path,
Input input)
|
boolean |
deleteResource(Config conf)
Method deleteResource deletes the resource represented by this instance. |
boolean |
equals(Object object)
|
String[] |
getChildPartitionIdentifiers(FlowProcess<Config> flowProcess,
boolean fullyQualified)
Method getChildPartitionIdentifiers returns an array of all identifiers for all available partitions. |
protected abstract String |
getCurrentIdentifier(FlowProcess<Config> flowProcess)
|
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 |
getOpenWritesThreshold()
Method getOpenWritesThreshold returns the openTapsThreshold of this PartitionTap object. |
Tap |
getParent()
Method getParent returns the parent Tap of this PartitionTap object. |
Partition |
getPartition()
Method getPartition returns the Partition instance used by this PartitionTap |
int |
hashCode()
|
TupleEntryIterator |
openForRead(FlowProcess<Config> flowProcess,
Input input)
Method openForRead opens the resource represented by this Tap instance for reading. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int OPEN_WRITES_THRESHOLD_DEFAULT
protected Tap parent
protected Partition partition
protected boolean keepParentOnDelete
protected int openWritesThreshold
Constructor Detail |
---|
protected BasePartitionTap(Tap parent, Partition partition, int openWritesThreshold)
protected BasePartitionTap(Tap parent, Partition partition, SinkMode sinkMode)
protected BasePartitionTap(Tap parent, Partition partition, SinkMode sinkMode, boolean keepParentOnDelete, int openWritesThreshold)
Method Detail |
---|
protected abstract TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<Config> flowProcess, Tap parent, String path, long sequence) throws IOException
IOException
protected abstract TupleEntrySchemeIterator createTupleEntrySchemeIterator(FlowProcess<Config> flowProcess, Tap parent, String path, Input input) throws IOException
IOException
public Tap getParent()
public Partition getPartition()
Partition
instance used by this PartitionTap
public String[] getChildPartitionIdentifiers(FlowProcess<Config> flowProcess, boolean fullyQualified) throws IOException
flowProcess
- of type FlowProcessfullyQualified
- of type boolean
IOException
public String getIdentifier()
Tap
getIdentifier
in class Tap<Config,Input,Output>
protected abstract String getCurrentIdentifier(FlowProcess<Config> flowProcess)
public int getOpenWritesThreshold()
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,Input,Output>
flowProcess
- of type FlowProcessoutput
- of type Output
IOException
- when the resource cannot be openedpublic 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,Output>
flowProcess
- of type FlowProcessinput
- of type Input
IOException
- when the resource cannot be openedpublic boolean createResource(Config conf) throws IOException
Tap
createResource
in class Tap<Config,Input,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,Input,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,Input,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,Input,Output>
conf
- of type Config
IOException
public boolean resourceExists(Config conf) throws IOException
Tap
resourceExists
in class Tap<Config,Input,Output>
conf
- of type Config
IOException
- when the status cannot be determinedpublic long getModifiedTime(Config conf) throws IOException
Tap
getModifiedTime
in class Tap<Config,Input,Output>
conf
- of type Config
IOException
public boolean equals(Object object)
equals
in class Tap<Config,Input,Output>
public int hashCode()
hashCode
in class Tap<Config,Input,Output>
public String toString()
toString
in class Tap<Config,Input,Output>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |