blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/MetricIndexData.java
private Set<String> getCompleteMetricNames(Map<String, MetricIndexDocCount> metricIndexMap) {

        Set<String> completeMetricNames = new HashSet<String>();
        for (Map.Entry<String, MetricIndexDocCount> entry : metricIndexMap.entrySet()) {

            MetricIndexDocCount metricIndexDocCount = entry.getValue();
            if (metricIndexDocCount != null) {

                //if total doc count is greater than its children docs, its a complete metric name
                if (metricIndexDocCount.actualDocCount > 0 &&
                        metricIndexDocCount.actualDocCount > metricIndexDocCount.childrenTotalDocCount) {
                    completeMetricNames.add(entry.getKey());
                }
            }
        }

        return Collections.unmodifiableSet(completeMetricNames);
    }
private Set<String> getCompleteMetricNames(Map<String, MetricIndexDocCount> metricIndexMap) {

        Set<String> completeMetricNames = new HashSet<String>();
        for (Map.Entry<String, MetricIndexDocCount> entry : metricIndexMap.entrySet()) {

            MetricIndexDocCount metricIndexDocCount = entry.getValue();
            if (metricIndexDocCount != null) {

                //if total doc count is greater than its children docs, its a complete metric name
                if (metricIndexDocCount.actualDocCount > 0 &&
                        metricIndexDocCount.actualDocCount > metricIndexDocCount.childrenTotalDocCount) {
                    completeMetricNames.add(entry.getKey());
                }
            }
        }

        return Collections.unmodifiableSet(completeMetricNames);
    }
private Set < String > getCompleteMetricNames ( Map < String , MetricIndexDocCount > metricIndexMap ) { Set < String > completeMetricNames = new HashSet < String > ( ) ; for ( Map . Entry < String , MetricIndexDocCount > entry : metricIndexMap . entrySet ( ) ) { MetricIndexDocCount metricIndexDocCount = entry . getValue ( ) ; if ( metricIndexDocCount != null ) { //if total doc count is greater than its children docs, its a complete metric name if ( metricIndexDocCount . actualDocCount > 0 && metricIndexDocCount . actualDocCount > metricIndexDocCount . childrenTotalDocCount ) { completeMetricNames . add ( entry . getKey ( ) ) ; } } } return Collections . unmodifiableSet ( completeMetricNames ) ; }
Compares actualDocCount and total docCount of its immediate children of an index
to determine if the metric index is a complete metric name or not.

For the ES response shown in class description, for a baseLevel of 2,
foo.bar.baz has actualDocCount of 2, but total doc count of all its children,
which in this case is only foo.bar.baz, is 1. So foo.bar.baz must be metric by itself

@param metricIndexMap
@return
Compares actualDocCount and total docCount of its immediate children of an index to determine if the metric index is a complete metric name or not .