processedReadersCount.inc();
Object facetDataObj = reader.getFacetData(facetName);
if (facetDataObj == null || !(facetDataObj instanceof FacetDataCache)) {
throw new IllegalStateException("Couldn't extract the facet data cache for the facet - " + facetName);
}
FacetDataCache facetDataCache= (FacetDataCache)reader.getFacetData(facetName);
if (!(facetDataCache.valArray instanceof TermLongList)) {
throw new IllegalStateException("Currently only the long field is supported for the time facet - " + facetName);
}
long[] elements = ((TermLongList)facetDataCache.valArray).getElements();
if (elements.length < 2) {