@Override
  public int getPendingEventCount() {
    if (!isDurableClient() || queueManager == null) {
      throw new IllegalStateException(
          "Only durable clients should call getPendingEventCount()");
    }
    if (readyForEventsCalled) {
      throw new IllegalStateException(
          "getPendingEventCount() should be called before invoking readyForEvents().");
    }
    return primaryQueueSize.get();
  }
This is only for multi-user case

Assert thread-local var is not null.

If serverLocation is non-null, check if the the user is authenticated on that server. If not,
authenticate it and return.
geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java