use of org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator in project asterixdb by apache.
the class JobBuilder method setSpecifiedPartitionConstraints.
private void setSpecifiedPartitionConstraints() {
for (ILogicalOperator op : pcForMicroOps.keySet()) {
AlgebricksPartitionConstraint pc = pcForMicroOps.get(op);
Integer k = algebraicOpBelongingToMetaAsterixOp.get(op);
AlgebricksMetaOperatorDescriptor amod = metaAsterixOps.get(k);
partitionConstraintMap.put(amod, pc);
}
for (IOperatorDescriptor opDesc : partitionConstraintMap.keySet()) {
AlgebricksPartitionConstraint pc = partitionConstraintMap.get(opDesc);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(jobSpec, opDesc, pc);
}
}
use of org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator 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.base.ILogicalOperator in project asterixdb by apache.
the class JobBuilder method buildSpec.
@Override
public void buildSpec(List<ILogicalOperator> roots) throws AlgebricksException {
buildAsterixComponents();
Map<IConnectorDescriptor, TargetConstraint> tgtConstraints = setupConnectors();
for (ILogicalOperator r : roots) {
IOperatorDescriptor opDesc = findOpDescForAlgebraicOp(r);
jobSpec.addRoot(opDesc);
}
setAllPartitionConstraints(tgtConstraints);
}
use of org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator in project asterixdb by apache.
the class OperatorPropertiesUtil method computeSchemaAndPropertiesRecIfNull.
public static void computeSchemaAndPropertiesRecIfNull(AbstractLogicalOperator op, IOptimizationContext context) throws AlgebricksException {
if (op.getSchema() == null) {
for (Mutable<ILogicalOperator> i : op.getInputs()) {
computeSchemaAndPropertiesRecIfNull((AbstractLogicalOperator) i.getValue(), context);
}
if (op.hasNestedPlans()) {
AbstractOperatorWithNestedPlans a = (AbstractOperatorWithNestedPlans) op;
for (ILogicalPlan p : a.getNestedPlans()) {
for (Mutable<ILogicalOperator> r : p.getRoots()) {
computeSchemaAndPropertiesRecIfNull((AbstractLogicalOperator) r.getValue(), context);
}
}
}
op.recomputeSchema();
op.computeDeliveredPhysicalProperties(context);
}
}
use of org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator in project asterixdb by apache.
the class OperatorPropertiesUtil method getFreeVariablesInSelfOrDesc.
/**
* Adds the free variables of the plan rooted at that operator to the
* collection provided.
*
* @param op
* @param vars
* - The collection to which the free variables will be added.
*/
public static void getFreeVariablesInSelfOrDesc(AbstractLogicalOperator op, Set<LogicalVariable> freeVars) throws AlgebricksException {
HashSet<LogicalVariable> produced = new HashSet<>();
VariableUtilities.getProducedVariables(op, produced);
for (LogicalVariable v : produced) {
freeVars.remove(v);
}
HashSet<LogicalVariable> used = new HashSet<>();
VariableUtilities.getUsedVariables(op, used);
for (LogicalVariable v : used) {
freeVars.add(v);
}
if (op.hasNestedPlans()) {
AbstractOperatorWithNestedPlans s = (AbstractOperatorWithNestedPlans) op;
getFreeVariablesInSubplans(s, freeVars);
}
for (Mutable<ILogicalOperator> i : op.getInputs()) {
getFreeVariablesInSelfOrDesc((AbstractLogicalOperator) i.getValue(), freeVars);
}
}
Aggregations