/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static CompressionProperty of(final Value value) { return new CompressionProperty(value); }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> dag.getIncomingEdgesOf(vertex).stream() .filter(edge -> !edge.getPropertyValue(CompressionProperty.class).isPresent()) .forEach(edge -> edge.setProperty(CompressionProperty.of(compression)))); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> dag.getIncomingEdgesOf(vertex).stream() .filter(edge -> !edge.getPropertyValue(CompressionProperty.class).isPresent()) .forEach(edge -> edge.setProperty(CompressionProperty.of(compression)))); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.getVertices().forEach(vertex -> { final List<IREdge> inEdges = dag.getIncomingEdgesOf(vertex); inEdges.forEach(edge -> { if (edge.getPropertyValue(CommunicationPatternProperty.class).get() .equals(CommunicationPatternProperty.Value.Shuffle)) { edge.setPropertyPermanently(CompressionProperty.of(CompressionProperty.Value.LZ4)); dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(CompressionProperty.of(CompressionProperty.Value.None))); } }); }); return dag; } }
/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static CompressionProperty of(final Value value) { return new CompressionProperty(value); }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.getVertices().forEach(vertex -> { final List<IREdge> inEdges = dag.getIncomingEdgesOf(vertex); inEdges.forEach(edge -> { if (edge.getPropertyValue(CommunicationPatternProperty.class).get() .equals(CommunicationPatternProperty.Value.Shuffle)) { edge.setPropertyPermanently(CompressionProperty.of(CompressionProperty.Value.LZ4)); dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(CompressionProperty.of(CompressionProperty.Value.None))); } }); }); return dag; } }