public boolean waitToTerminate(long timeOutMs) throws InterruptedException {
    return opTerminateMonitorLatch.await(timeOutMs, TimeUnit.MILLISECONDS);
  }
Wait until the operation terminates and returns false if timeout.
@param timeOutMs - timeout in milli-seconds
@return true if operation is terminated or false if timed-out
@throws InterruptedException
service/src/java/org/apache/hive/service/cli/operation/Operation.java