/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static DecompressionProperty of(final CompressionProperty.Value value) { return new DecompressionProperty(value); } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> dag.getIncomingEdgesOf(vertex).stream() // Find edges which have a compression property but not decompression property. .filter(edge -> edge.getPropertyValue(CompressionProperty.class).isPresent() && !edge.getPropertyValue(DecompressionProperty.class).isPresent()) .forEach(edge -> edge.setProperty(DecompressionProperty.of( edge.getPropertyValue(CompressionProperty.class).get())))); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(vertex -> dag.getIncomingEdgesOf(vertex).stream() // Find edges which have a compression property but not decompression property. .filter(edge -> edge.getPropertyValue(CompressionProperty.class).isPresent() && !edge.getPropertyValue(DecompressionProperty.class).isPresent()) .forEach(edge -> edge.setProperty(DecompressionProperty.of( edge.getPropertyValue(CompressionProperty.class).get())))); 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(DecompressionProperty.of(CompressionProperty.Value.None)); dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(DecompressionProperty.of(CompressionProperty.Value.LZ4))); } }); }); return dag; } }
/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static DecompressionProperty of(final CompressionProperty.Value value) { return new DecompressionProperty(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(DecompressionProperty.of(CompressionProperty.Value.None)); dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(DecompressionProperty.of(CompressionProperty.Value.LZ4))); } }); }); return dag; } }