private Map<PersistentMemberID, Set<Integer>> getMembersToWaitFor(boolean offlineOnly)
        throws RegionDestroyedException {
      Map<PersistentMemberID, Set<Integer>> waitingForMembers =
          new HashMap<>();


      boolean allBucketsClosed = true;
      for (ProxyBucketRegion proxyBucket : bucketRegions) {
        Integer bucketId = proxyBucket.getBucketId();

        // Get the set of missing members from the persistence advisor
        Set<PersistentMemberID> missingMembers;
        BucketPersistenceAdvisor persistenceAdvisor = proxyBucket.getPersistenceAdvisor();

        if (persistenceAdvisor.isClosed()) {
          continue;
        }
        allBucketsClosed = false;
        if (offlineOnly) {
          missingMembers = persistenceAdvisor.getMissingMembers();
        } else {
          missingMembers = persistenceAdvisor.getAllMembersToWaitFor();
        }

        if (missingMembers != null) {
          for (PersistentMemberID missingMember : missingMembers) {
            Set<Integer> buckets = waitingForMembers.get(missingMember);
            if (buckets == null) {
              buckets = new TreeSet<>();
              waitingForMembers.put(missingMember, buckets);
            }
            buckets.add(bucketId);
          }
        }
      }
      if (allBucketsClosed) {
        throw new RegionDestroyedException("The Region has been closed or destroyed", region);
      }

      return waitingForMembers;
    }
Returns a unique Set of persistent members that all the ProxyBucketRegions are waiting for.

@param offlineOnly true if only the members which are not currently try running should be
       returned, false to return all members that this member is waiting for, including
       members which are running but not fully initialized.
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PersistentBucketRecoverer.java