private Long getNextAvailableID() throws InterruptedException {
    Long next = null;
    acquireReadLock();
    try {
      if (idsAvailable.isEmpty()) {
        // Asif:Wait in case it is a blocking thread
        if (waitForData()) {
          next = (Long) idsAvailable.iterator().next();
        }
      } else {
        next = (Long) idsAvailable.iterator().next();
      }
    } finally {
      releaseReadLock();
    }
    return next;
  }
Returns the next position counter present in idsAvailable set. This method is invoked by the
peek function. In case of BlockingQueue, this method waits till a valid ID is available.

@return valid Long poistion or null depending upon the nature of the queue
@throws TimeoutException if operation is interrupted (unfortunately)
geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java