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 .