コード例 #1
0
  // This function is replicated in Dag.java
  @SuppressWarnings("unused")
  private Format getChildFormat(Lop node) throws LopsException {

    if (node.getOutputParameters().getFile_name() != null
        || node.getOutputParameters().getLabel() != null) {
      return node.getOutputParameters().getFormat();
    } else {
      // Reblock lop should always have a single child
      if (node.getInputs().size() > 1)
        throw new LopsException(this.printErrorLocation() + "Should only have one child! \n");

      /*
       * Return the format of the child node (i.e., input lop)
       * No need of recursion here.. because
       * 1) Reblock lop's input can either be DataLop or some intermediate computation
       *    If it is Data then we just take its format (TEXT or BINARY)
       *    If it is intermediate lop then it is always BINARY
       *      since we assume that all intermediate computations will be in Binary format
       * 2) Note that Reblock job will never have any instructions in the mapper
       *    => the input lop (if it is other than Data) is always executed in a different job
       */
      // return getChildFormat(node.getInputs().get(0));
      return node.getInputs().get(0).getOutputParameters().getFormat();
    }
  }