int getNumberOfNodes() {
    if (nodes != null) {
      return nodes.size();
    } else {
      return 0;
    }
  }
Return a safe, light weight size of the nodes

@return number of VMs that participate in the PartitionedRegion
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfig.java