public static void sleepWithoutInterrupt(final long msToWait) {
    long timeMillis = EnvironmentEdgeManager.currentTime();
    long endTime = timeMillis + msToWait;
    boolean interrupted = false;
    while (timeMillis < endTime) {
      try {
        Thread.sleep(endTime - timeMillis);
      } catch (InterruptedException ex) {
        interrupted = true;
      }
      timeMillis = EnvironmentEdgeManager.currentTime();
    }

    if (interrupted) {
      Thread.currentThread().interrupt();
    }
  }
Sleeps for the given amount of time even if interrupted. Preserves the interrupt status.
@param msToWait the amount of time to sleep in milliseconds
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java