private void sleep(long idleSleepTime, int origResets) throws InterruptedException {
      long checkIntrvalMs = 1000;
      for (long i = 0; i < idleSleepTime; i += checkIntrvalMs) {
        Thread.sleep(checkIntrvalMs);
        if (forcedScheduleCheckCounter.get() != origResets) {
          return;
        }
      }
    }
The poller is responsible for checking for available scheduled queries.

It also handles forced wakeup calls to reduce the impact that the default check period might be minutes.
There might be only 1 running poller service at a time in a hiveserver instance.
ql/src/java/org/apache/hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java