@Override
  public T poll(long timeout, TimeUnit unit) throws InterruptedException {
    long nanos = unit.toNanos(timeout);
    lock.lockInterruptibly();
    try {
      while (true) {
        T retVal = this.poll();
        if (retVal == null) {
          retVal = stealFromQueue.poll();
        }
        if (retVal == null) {
          if (nanos <= 0) return null;
          nanos = notEmpty.awaitNanos(nanos);
        } else {
          return retVal;
        }
      }
    } finally {
      lock.unlock();
    }
  }
Get a queue whose job might be stolen by the consumer of this original queue
@return the queue whose job could be stolen
hbase-server/src/main/java/org/apache/hadoop/hbase/util/StealJobQueue.java