public Set<Integer> getAllLocalPrimaryBucketIds() {
    Set<Integer> bucketIds = new HashSet<>();
    for (Map.Entry<Integer, BucketRegion> bucketEntry : getAllLocalBuckets()) {
      BucketRegion bucket = bucketEntry.getValue();
      if (bucket.getBucketAdvisor().isPrimary()) {
        bucketIds.add(bucket.getId());
      }
    }
    return bucketIds;
  }
Returns a set of local buckets.

@return an unmodifiable set of BucketRegion
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java