public static void checkInterrupted() {
    if (Thread.currentThread().isInterrupted()) {
      InterruptedException interrupt = null;
      try {
        Thread.sleep(0);
      } catch (InterruptedException e) {
        interrupt = e;
      }
      throw new RuntimeException("Interrupted", interrupt);
    }
  }
Checks if the current thread has been interrupted and throws RuntimeException is it has.
common/src/java/org/apache/hadoop/hive/common/HiveInterruptUtils.java