public int size() {
        return size;
    }
Get the number of partitions that are currently being tracked. This is thread-safe.
clients/src/main/java/org/apache/kafka/common/internals/PartitionStates.java