class AttributeMetadata {

    public Stream<KeyFrequency<A>> getFrequencyDistribution() {
        QueryOptions queryOptions = openResources();
        return asKeyFrequencyStream(queryOptions, index.getStatisticsForDistinctKeys(queryOptions));
    }

      AttributeMetadata(KeyStatisticsIndex<A, O> index, Supplier<QueryOptions> openResourcesHandler, Consumer<QueryOptions> closeResourcesHandler);

}