use of org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractReplicateOperator in project asterixdb by apache.
the class PlanCompiler method reviseEdges.
private void reviseEdges(IHyracksJobBuilder builder) {
/**
* revise the edges for the case of replicate operator
*/
for (Entry<Mutable<ILogicalOperator>, List<Mutable<ILogicalOperator>>> entry : operatorVisitedToParents.entrySet()) {
Mutable<ILogicalOperator> child = entry.getKey();
List<Mutable<ILogicalOperator>> parents = entry.getValue();
if (parents.size() > 1) {
if (child.getValue().getOperatorTag() == LogicalOperatorTag.REPLICATE || child.getValue().getOperatorTag() == LogicalOperatorTag.SPLIT) {
AbstractReplicateOperator rop = (AbstractReplicateOperator) child.getValue();
if (rop.isBlocker()) {
// make the order of the graph edges consistent with the order of rop's outputs
List<Mutable<ILogicalOperator>> outputs = rop.getOutputs();
for (Mutable<ILogicalOperator> parent : parents) {
builder.contributeGraphEdge(child.getValue(), outputs.indexOf(parent), parent.getValue(), 0);
}
} else {
int i = 0;
for (Mutable<ILogicalOperator> parent : parents) {
builder.contributeGraphEdge(child.getValue(), i, parent.getValue(), 0);
i++;
}
}
}
}
}
}
use of org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractReplicateOperator in project asterixdb by apache.
the class AbstractReplicatePOperator method getInputOutputDependencyLabels.
@Override
public Pair<int[], int[]> getInputOutputDependencyLabels(ILogicalOperator op) {
int[] inputDependencyLabels = new int[] { 0 };
AbstractReplicateOperator rop = (AbstractReplicateOperator) op;
int[] outputDependencyLabels = new int[rop.getOutputArity()];
// change the labels of outputs that requires materialization to 1
boolean[] outputMaterializationFlags = rop.getOutputMaterializationFlags();
for (int i = 0; i < rop.getOutputArity(); i++) {
if (outputMaterializationFlags[i]) {
outputDependencyLabels[i] = 1;
}
}
return new Pair<>(inputDependencyLabels, outputDependencyLabels);
}
Aggregations