public class OperatorTopologyImpl extends Object implements OperatorTopology
| Constructor and Description |
|---|
OperatorTopologyImpl(Class<? extends Name<String>> groupName,
Class<? extends Name<String>> operName,
String selfId,
String driverId,
Sender sender,
int version) |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(GroupCommunicationMessage msg)
Handle messages meant for this operator.
|
void |
initialize() |
byte[] |
recvFromChildren() |
<T> T |
recvFromChildren(Reduce.ReduceFunction<T> redFunc,
Codec<T> dataCodec) |
byte[] |
recvFromParent(ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) |
void |
sendToChildren(byte[] data,
ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) |
void |
sendToChildren(Map<String,byte[]> dataMap,
ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) |
void |
sendToParent(byte[] data,
ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) |
public void handle(GroupCommunicationMessage msg)
No synchronization is needed while handling *Dead messages. There 2 states: UpdatingTopo and NotUpdatingTopo If UpdatingTopo, deltas.put still takes care of adding this msg to effTop through baseTopo changes. If not, we add to effTopo. So we are good.
However, for data msgs synchronization is needed. Look at doc of DataHandlingStage
Adding to deletionDeltas should be outside effTopo!=null block. There is a rare possibility that during initialization just after baseTopo is created(so deltas will be ignored) and just before effTopo is created(so effTopo will be null) where we can miss a deletion msg if not added to deletionDelta because this method is synchronized
handle in interface OperatorTopologypublic void initialize() throws ParentDeadException
initialize in interface OperatorTopologyParentDeadExceptionpublic void sendToParent(byte[] data, ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) throws ParentDeadException
sendToParent in interface OperatorTopologyParentDeadExceptionpublic void sendToChildren(byte[] data, ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) throws ParentDeadException
sendToChildren in interface OperatorTopologyParentDeadExceptionpublic void sendToChildren(Map<String,byte[]> dataMap, ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) throws ParentDeadException
sendToChildren in interface OperatorTopologyParentDeadExceptionpublic byte[] recvFromParent(ReefNetworkGroupCommProtos.GroupCommMessage.Type msgType) throws ParentDeadException
recvFromParent in interface OperatorTopologyParentDeadExceptionpublic <T> T recvFromChildren(Reduce.ReduceFunction<T> redFunc, Codec<T> dataCodec) throws ParentDeadException
recvFromChildren in interface OperatorTopologyParentDeadExceptionpublic byte[] recvFromChildren() throws ParentDeadException
recvFromChildren in interface OperatorTopologyParentDeadExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.