public StreamNested(R builder) { super(new AstWriteNotifyNode(), builder); }
public AstWriteNotifyNodeBuilder setBarrierName(String barrierName) { node.setBarrierName(barrierName); return this; }
@Override public Configuration visit(AstWriteNotifyNode node, State state) { RegionInfo regionInfo = node.getRegionInfo(); String barrierName = node.getBarrierName(); Barrier barrier = state.lookupBarrier(barrierName); NotifyBarrierHandler handler = new NotifyBarrierHandler(barrier); handler.setRegionInfo(regionInfo); Map<String, ChannelHandler> pipelineAsMap = state.pipelineAsMap; String handlerName = String.format("write.notify#%d", pipelineAsMap.size() + 1); pipelineAsMap.put(handlerName, handler); state.configuration.getBarriers().add(barrier); return state.configuration; }
@Override public AstWriteNotifyNode visitWriteNotifyNode(WriteNotifyNodeContext ctx) { node = new AstWriteNotifyNode(); node.setRegionInfo(asSequentialRegion(childInfos, ctx)); node.setBarrierName(ctx.Name().getText()); return node; }
@Override protected void describe(StringBuilder buf) { super.describe(buf); buf.append(format("write notify %s\n", getBarrierName())); } }
@Override public AstWriteNotifyNode visitWriteNotifyNode(WriteNotifyNodeContext ctx) { AstWriteNotifyNodeVisitor visitor = new AstWriteNotifyNodeVisitor(factory, environment); AstWriteNotifyNode writeNotifyNode = visitor.visitWriteNotifyNode(ctx); if (writeNotifyNode != null) { childInfos().add(writeNotifyNode.getRegionInfo()); } return writeNotifyNode; }
public StreamNested<R> setBarrierName(String barrierName) { node.setBarrierName(barrierName); return this; }
public AstWriteNotifyNodeBuilder() { this(new AstWriteNotifyNode()); }