private synchronized double getTotalCardinality() { double sum = 0.0; for (final SplitInfo si : splitInfo.values()) { for (final RangeLocationPair pair : si.getRangeLocationPairs()) { sum += pair.getCardinality(); } } return sum; } }
synchronized void merge(final IntermediateSplitInfo split) { for (final Entry<String, SplitInfo> e : split.splitInfo.entrySet()) { SplitInfo thisInfo = splitInfo.get(e.getKey()); if (thisInfo == null) { thisInfo = new SplitInfo(e.getValue().getIndex()); splitInfo.put(e.getKey(), thisInfo); } thisInfo.getRangeLocationPairs().addAll(e.getValue().getRangeLocationPairs()); } }
/** * This implementation of length is only an estimate, it does not provide exact values. Do not * have your code rely on this return value. */ @Override public long getLength() throws IOException { long diff = 0; for (final Entry<String, SplitInfo> indexEntry : splitInfo.entrySet()) { for (final RangeLocationPair range : indexEntry.getValue().getRangeLocationPairs()) { diff += (long) range.getCardinality(); } } return diff; }
private void addPairForIndex( final Map<String, SplitInfo> otherSplitInfo, final RangeLocationPair pair, final Index index) { SplitInfo other = otherSplitInfo.get(index.getName()); if (other == null) { other = new SplitInfo(index); otherSplitInfo.put(index.getName(), other); } other.getRangeLocationPairs().add(pair); }
double otherSum = 0; for (final SplitInfo s : splitInfo.values()) { pairs.addAll(s.getRangeLocationPairs()); otherPairs.addAll(s.getRangeLocationPairs());
for (final RangeLocationPair p : ranges.getValue().getRangeLocationPairs()) { orderedSplits.add(new IndexRangeLocation(p, ranges.getValue().getIndex()));
final NextRangeCallback callback) { if (!splitInfo.getRangeLocationPairs().isEmpty()) { final QueryFilter[] filters = ((queryFilters == null) || queryFilters.isEmpty()) ? null new ArrayList<>(splitInfo.getRangeLocationPairs().size()); for (final RangeLocationPair r : splitInfo.getRangeLocationPairs()) { indexReaders.add( Pair.of(
final Set<String> locations = new HashSet<>(); for (final Entry<String, SplitInfo> entry : splitInfo.entrySet()) { for (final RangeLocationPair pair : entry.getValue().getRangeLocationPairs()) { if ((pair.getLocation() != null) && !pair.getLocation().isEmpty()) { locations.add(pair.getLocation());