public int getNumberOfPrimaryBucketsManaged() {
    final AtomicInteger numPrimaries = new AtomicInteger();
    visitBuckets((bucketId, r) -> {
      BucketRegion br = (BucketRegion) r;
      if (br.getBucketAdvisor().isPrimary()) {
        numPrimaries.incrementAndGet();
      }
    });
    return numPrimaries.get();
  }
Report an estimate of the number of primary buckets managed locally The result of this method
is not stable.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java