@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { // On every vertex that receive push edge, if ResourceSlotProperty is not set, put it as false. // For other vertices, if ResourceSlotProperty is not set, put it as true. dag.getVertices().stream() .filter(v -> !v.getPropertyValue(ResourceSlotProperty.class).isPresent()) .forEach(v -> { if (dag.getIncomingEdgesOf(v).stream().anyMatch( e -> e.getPropertyValue(DataFlowProperty.class) .orElseThrow(() -> new RuntimeException(String.format("DataFlowProperty for %s must be set", e.getId()))).equals(DataFlowProperty.Value.Push))) { v.setPropertyPermanently(ResourceSlotProperty.of(false)); } else { v.setPropertyPermanently(ResourceSlotProperty.of(true)); } }); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { // On every vertex that receive push edge, if ResourceSlotProperty is not set, put it as false. // For other vertices, if ResourceSlotProperty is not set, put it as true. dag.getVertices().stream() .filter(v -> !v.getPropertyValue(ResourceSlotProperty.class).isPresent()) .forEach(v -> { if (dag.getIncomingEdgesOf(v).stream().anyMatch( e -> e.getPropertyValue(DataFlowProperty.class) .orElseThrow(() -> new RuntimeException(String.format("DataFlowProperty for %s must be set", e.getId()))).equals(DataFlowProperty.Value.Push))) { v.setPropertyPermanently(ResourceSlotProperty.of(false)); } else { v.setPropertyPermanently(ResourceSlotProperty.of(true)); } }); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> { final List<IREdge> inEdges = dag.getIncomingEdgesOf(vertex); if (inEdges.isEmpty()) { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.TRANSIENT)); } else { if (hasM2M(inEdges) || allO2OFromReserved(inEdges)) { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.RESERVED)); } else { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.TRANSIENT)); } } }); return dag; }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> { final List<IREdge> inEdges = dag.getIncomingEdgesOf(vertex); if (inEdges.isEmpty()) { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.TRANSIENT)); } else { if (hasM2M(inEdges) || allO2OFromReserved(inEdges)) { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.RESERVED)); } else { vertex.setPropertyPermanently(ResourcePriorityProperty.of(ResourcePriorityProperty.TRANSIENT)); } } }); return dag; }
cachedDataRelayVertex.setPropertyPermanently(ParallelismProperty.of(cacheIdToParallelism.get(cacheId.get())));
cachedDataRelayVertex.setPropertyPermanently(ParallelismProperty.of(cacheIdToParallelism.get(cacheId.get())));
srcVertex.setPropertyPermanently(ParallelismProperty.of(1)); sideInputTransformVertex.setPropertyPermanently(ParallelismProperty.of(1));