public synchronized boolean addToRunnable(Task<?> tsk) throws HiveException {
    if (runnable.contains(tsk)) {
      return false;
    }
    checkShutdown();
    runnable.add(tsk);
    tsk.setQueued();
    return true;
  }
Checks if a task can be launched.

@param tsk
         the task to be checked
@return true if the task is launchable, false otherwise
ql/src/java/org/apache/hadoop/hive/ql/TaskQueue.java