private void completeInitialization(Collection<Future<?>> fs) throws HiveException {
    Object[] os = new Object[fs.size()];
    int i = 0;
    Throwable asyncEx = null;

    // Wait for all futures to complete. Check for an abort while waiting for each future. If any of the futures is cancelled / aborted - cancel all subsequent futures.

    boolean cancelAll = false;
    for (Future<?> f : fs) {
      // If aborted - break out of the loop, and cancel all subsequent futures.
      if (cancelAll) {
        break;
      }
      if (abortOp.get()) {
        cancelAll = true;
        break;
      } else {
        // Wait for the current future.
        while (true) {
          if (abortOp.get()) {
            cancelAll = true;
            break;
          } else {
            try {
              // Await future result with a timeout to check the abort field occasionally.
              // It's possible that the interrupt which comes in along with an abort, is suppressed
              // by some other operator.
              Object futureResult = f.get(200l, TimeUnit.MILLISECONDS);
              os[i++] = futureResult;
              break;
            } catch (TimeoutException e) {
              // Expected if the operation takes time. Continue the loop, and wait for op completion.
            } catch (InterruptedException | CancellationException e) {
              asyncEx = e;
              cancelAll = true;
              break;
            } catch (ExecutionException e) {
              if (e.getCause() == null) {
                asyncEx = e;
              } else {
                asyncEx = e.getCause();
              }
              cancelAll = true;
              break;
            }
          }
        }
      }
    }

    if (cancelAll || asyncEx != null) {
      for (Future<?> f : fs) {
        // It's ok to send a cancel to an already completed future. Is a no-op
        f.cancel(true);
      }
      throw new HiveException("Async Initialization failed. abortRequested=" + abortOp.get(), asyncEx);
    }

    completeInitializationOp(os);
  }
Initializes operators only if all parents have been initialized. Calls
operator specific initializer which then initializes child ops.

@param hconf
@param inputOIs
         input object inspector array indexes by tag id. null value is
         ignored.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java