StreamTupleEntryQueue queue = null;
if (NodeTypeEnums.RightInputAdaterNode == sink.getType()) {
RightInputAdapterNode rian = (RightInputAdapterNode) sink;
RiaNodeMemory riaMem = (RiaNodeMemory) wm.getNodeMemory((MemoryFactory)sink);
RiaPathMemory pmem = riaMem.getRiaPathMemory();
queue = pmem.getStreamQueue();
if ( queue == null ) {
ObjectSink[] nodes = rian.getSinkPropagator().getSinks();
// iterate the first child sink, we only need the first, as all reach the same outer rtn
queue = initAndGetTupleQueue(nodes[0], wm);
}
} else if (NodeTypeEnums.isTerminalNode(sink)) {
PathMemory pmem = (PathMemory) wm.getNodeMemory((MemoryFactory) sink);
queue = pmem.getStreamQueue();
if ( queue == null ) {
pmem.initQueue();
queue = pmem.getStreamQueue();
}
for ( TerminalNode rtn = (TerminalNode) ( (TerminalNode) sink ).getPreviousLeftTupleSinkNode();
rtn != null;
rtn = (TerminalNode) rtn.getPreviousLeftTupleSinkNode() ) {
((PathMemory) wm.getNodeMemory( (MemoryFactory) rtn )).setStreamQueue( queue );