public static void setMemoryAvailable(final List<Operator<? extends OperatorDesc>> operators,
    final long memoryAvailableToTask) {
    if (operators == null) {
      return;
    }

    for (Operator<? extends OperatorDesc> op : operators) {
      if (op.getConf() != null) {
        op.getConf().setMaxMemoryAvailable(memoryAvailableToTask);
      }
      if (op.getChildOperators() != null && !op.getChildOperators().isEmpty()) {
        setMemoryAvailable(op.getChildOperators(), memoryAvailableToTask);
      }
    }
  }
Given an operator and a set of classes, it returns the number of operators it finds
upstream that instantiate any of the given classes.

@param start the start operator
@param classes the set of classes
@return the number of operators
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java