public class MToNRing extends java.lang.Object implements DataFlowOperation, ChannelReceiver
Constructor and Description |
---|
MToNRing(Config cfg,
TWSChannel channel,
LogicalPlan tPlan,
java.util.Set<java.lang.Integer> sources,
java.util.Set<java.lang.Integer> targets,
MessageReceiver finalRcvr,
MessageReceiver partialRcvr,
MessageType dType,
MessageType rcvType,
MessageType kType,
MessageType rcvKType,
int edge,
MessageSchema messageSchema)
Create a ring partition communication
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the operation
|
void |
finish(int source)
If this is a larger transfer of dataflow style, we need to finish
|
MessageType |
getDataType()
returns the data type that is associated with the data flow operation
|
MessageType |
getKeyType()
returns the key type that is associated with the data flow operation
|
LogicalPlan |
getLogicalPlan()
Task plan associated with this operation
|
MessageType |
getReceiveDataType()
returns the data type that is associated with the data flow operation
|
MessageType |
getReceiveKeyType()
returns the key type that is associated with the data flow operation
|
java.util.Set<java.lang.Integer> |
getSources()
Get the sources of the operation
|
java.util.Set<java.lang.Integer> |
getTargets()
Get targets of operation
|
java.lang.String |
getUniqueId()
Returns a unique id for this operation.
|
boolean |
isComplete()
Weather the operation doesn't have any pending sends or receives
|
boolean |
isDelegateComplete() |
boolean |
progress()
Progress the pending dataflow operations
|
boolean |
receiveMessage(MessageHeader header,
java.lang.Object object)
Receive a fully built message
|
boolean |
receiveSendInternally(int source,
int target,
int path,
int flags,
java.lang.Object message)
For partial receives the path and
|
void |
reset()
Reset and get the operation to initial state
|
boolean |
send(int source,
java.lang.Object message,
int flags)
Send a send message, this call will work asynchronously
|
boolean |
send(int source,
java.lang.Object message,
int flags,
int target)
Send the message on a specific path
|
boolean |
sendPartial(int source,
java.lang.Object message,
int flags)
Use this to inject partial results in a distributed dataflow operation
|
boolean |
sendPartial(int source,
java.lang.Object message,
int flags,
int target)
Send partial message on a specific path
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleReceivedChannelMessage, sendCompleted
public MToNRing(Config cfg, TWSChannel channel, LogicalPlan tPlan, java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> targets, MessageReceiver finalRcvr, MessageReceiver partialRcvr, MessageType dType, MessageType rcvType, MessageType kType, MessageType rcvKType, int edge, MessageSchema messageSchema)
cfg
- configurationchannel
- channeltPlan
- task plansources
- sourcestargets
- targetsfinalRcvr
- final receiverpartialRcvr
- partial receiverdType
- data typercvType
- receive data typekType
- key data typercvKType
- receive key typeedge
- the edgepublic boolean sendPartial(int source, java.lang.Object message, int flags)
DataFlowOperation
sendPartial
in interface DataFlowOperation
message
- messagepublic boolean send(int source, java.lang.Object message, int flags)
DataFlowOperation
send
in interface DataFlowOperation
source
- source taskmessage
- message as a generic objectpublic boolean send(int source, java.lang.Object message, int flags, int target)
DataFlowOperation
send
in interface DataFlowOperation
source
- source taskmessage
- a generic java objecttarget
- target taskpublic boolean sendPartial(int source, java.lang.Object message, int flags, int target)
DataFlowOperation
sendPartial
in interface DataFlowOperation
source
- the sourcemessage
- message as a generic objecttarget
- the final targetpublic boolean progress()
DataFlowOperation
progress
in interface DataFlowOperation
public void close()
DataFlowOperation
close
in interface DataFlowOperation
public void reset()
DataFlowOperation
reset
in interface DataFlowOperation
public LogicalPlan getLogicalPlan()
DataFlowOperation
getLogicalPlan
in interface DataFlowOperation
public java.lang.String getUniqueId()
DataFlowOperation
getUniqueId
in interface DataFlowOperation
public boolean isComplete()
DataFlowOperation
isComplete
in interface DataFlowOperation
public MessageType getKeyType()
DataFlowOperation
getKeyType
in interface DataFlowOperation
public MessageType getDataType()
DataFlowOperation
getDataType
in interface DataFlowOperation
public java.util.Set<java.lang.Integer> getSources()
DataFlowOperation
getSources
in interface DataFlowOperation
public java.util.Set<java.lang.Integer> getTargets()
DataFlowOperation
getTargets
in interface DataFlowOperation
public boolean receiveMessage(MessageHeader header, java.lang.Object object)
ChannelReceiver
receiveMessage
in interface ChannelReceiver
header
- the headerobject
- the built messagepublic boolean receiveSendInternally(int source, int target, int path, int flags, java.lang.Object message)
ChannelReceiver
receiveSendInternally
in interface ChannelReceiver
source
- the sourcetarget
- target to be sentpath
- the path to be usedflags
- flagsmessage
- messagepublic boolean isDelegateComplete()
isDelegateComplete
in interface DataFlowOperation
public void finish(int source)
DataFlowOperation
finish
in interface DataFlowOperation
public MessageType getReceiveKeyType()
DataFlowOperation
getReceiveKeyType
in interface DataFlowOperation
public MessageType getReceiveDataType()
DataFlowOperation
getReceiveDataType
in interface DataFlowOperation