/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static PartitionerProperty of(final Value value) { return new PartitionerProperty(value); }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.getVertices() .forEach(v -> dag.getOutgoingEdgesOf(v).stream() .filter(edge -> edge.getPropertyValue(MetricCollectionProperty.class).isPresent()) .forEach(skewEdge -> skewEdge .setPropertyPermanently(PartitionerProperty.of(PartitionerProperty.Value.DataSkewHashPartitioner)) ) ); 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)) { dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(PartitionerProperty.of( PartitionerProperty.Value.DedicatedKeyPerElementPartitioner))); } }); }); return dag; } }
@Override public DAG<IRVertex, IREdge> apply(final DAG<IRVertex, IREdge> dag) { dag.getVertices().forEach(v -> { if (v instanceof OperatorVertex && ((OperatorVertex) v).getTransform() instanceof AggregateMetricTransform) { final List<IREdge> outEdges = dag.getOutgoingEdgesOf(v); outEdges.forEach(edge -> { // double checking. if (MetricCollectionProperty.Value.DataSkewRuntimePass .equals(edge.getPropertyValue(MetricCollectionProperty.class).get())) { edge.setPropertyPermanently(PartitionerProperty.of(PartitionerProperty.Value.DataSkewHashPartitioner)); } }); } }); return dag; } }
/** * Static method exposing the constructor. * * @param value value of the new execution property. * @return the newly created execution property. */ public static PartitionerProperty of(final Value value) { return new PartitionerProperty(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)) { dag.getOutgoingEdgesOf(edge.getDst()) .forEach(edgeFromRelay -> edgeFromRelay.setPropertyPermanently(PartitionerProperty.of( PartitionerProperty.Value.DedicatedKeyPerElementPartitioner))); } }); }); return dag; } }
switch (commPattern) { case Shuffle: map.put(PartitionerProperty.of(PartitionerProperty.Value.HashPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore)); break; case BroadCast: map.put(PartitionerProperty.of(PartitionerProperty.Value.IntactPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore)); break; case OneToOne: map.put(PartitionerProperty.of(PartitionerProperty.Value.IntactPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.MemoryStore)); break; default: map.put(PartitionerProperty.of(PartitionerProperty.Value.HashPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore));
switch (commPattern) { case Shuffle: map.put(PartitionerProperty.of(PartitionerProperty.Value.HashPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore)); break; case BroadCast: map.put(PartitionerProperty.of(PartitionerProperty.Value.IntactPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore)); break; case OneToOne: map.put(PartitionerProperty.of(PartitionerProperty.Value.IntactPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.MemoryStore)); break; default: map.put(PartitionerProperty.of(PartitionerProperty.Value.HashPartitioner)); map.put(DataStoreProperty.of(DataStoreProperty.Value.LocalFileStore));