/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static DataSkewMetricProperty of(final DataSkewMetricFactory value) { return new DataSkewMetricProperty(value); } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(dst -> dag.getIncomingEdgesOf(dst).forEach(edge -> { if (CommunicationPatternProperty.Value.Shuffle .equals(edge.getPropertyValue(CommunicationPatternProperty.class).get())) { final int parallelism = dst.getPropertyValue(ParallelismProperty.class).get(); final Map<Integer, KeyRange> metric = new HashMap<>(); for (int i = 0; i < parallelism; i++) { metric.put(i, HashRange.of(i, i + 1, false)); } edge.setProperty(DataSkewMetricProperty.of(new DataSkewMetricFactory(metric))); } })); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.topologicalDo(dst -> dag.getIncomingEdgesOf(dst).forEach(edge -> { if (CommunicationPatternProperty.Value.Shuffle .equals(edge.getPropertyValue(CommunicationPatternProperty.class).get())) { final int parallelism = dst.getPropertyValue(ParallelismProperty.class).get(); final Map<Integer, KeyRange> metric = new HashMap<>(); for (int i = 0; i < parallelism; i++) { metric.put(i, HashRange.of(i, i + 1, false)); } edge.setProperty(DataSkewMetricProperty.of(new DataSkewMetricFactory(metric))); } })); return dag; } }
/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static DataSkewMetricProperty of(final DataSkewMetricFactory value) { return new DataSkewMetricProperty(value); } }