@Override
  public CallRunner poll() {
    CallRunner cr;
    boolean switched = false;
    while (true) {
      if (((double) queue.size() / this.maxCapacity) > lifoThreshold) {
        // Only count once per switch.
        if (!switched) {
          switched = true;
          numLifoModeSwitches.increment();
        }
        cr = queue.pollLast();
      } else {
        switched = false;
        cr = queue.pollFirst();
      }
      if (cr == null) {
        return cr;
      }
      if (needToDrop(cr)) {
        numGeneralCallsDropped.increment();
        cr.drop();
      } else {
        return cr;
      }
    }
  }
Behaves as {@link LinkedBlockingQueue#take()}, except it will silently skip all calls which it
thinks should be dropped.
@return the head of this queue
@throws InterruptedException if interrupted while waiting
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/AdaptiveLifoCoDelCallQueue.java