Search in sources :

Example 1 with IteratorValidator

use of org.apache.drill.exec.physical.config.IteratorValidator in project drill by apache.

the class IteratorValidatorInjector method visitOp.

/**
   * Traverse the physical plan and inject the IteratorValidator operator after every operator.
   *
   * @param op
   *          Physical operator under which the IteratorValidator operator will be injected
   * @param context
   *          Fragment context
   * @return same physical operator as passed in, but its child will be a IteratorValidator operator whose child will be the
   *         original child of this operator
   * @throws ExecutionSetupException
   */
@Override
public PhysicalOperator visitOp(PhysicalOperator op, FragmentContext context) throws ExecutionSetupException {
    List<PhysicalOperator> newChildren = Lists.newArrayList();
    PhysicalOperator newOp = op;
    /* Get the list of child operators */
    for (PhysicalOperator child : op) {
        PhysicalOperator validator = new IteratorValidator(child.accept(this, context));
        validator.setOperatorId(op.getOperatorId() + 1000);
        newChildren.add(validator);
    }
    /* Inject trace operator */
    if (newChildren.size() > 0) {
        newOp = op.getNewWithChildren(newChildren);
        newOp.setOperatorId(op.getOperatorId());
    }
    return newOp;
}
Also used : PhysicalOperator(org.apache.drill.exec.physical.base.PhysicalOperator) IteratorValidator(org.apache.drill.exec.physical.config.IteratorValidator)

Aggregations

PhysicalOperator (org.apache.drill.exec.physical.base.PhysicalOperator)1 IteratorValidator (org.apache.drill.exec.physical.config.IteratorValidator)1