public IndexSummaryBuilder(long expectedKeys, int minIndexInterval, int samplingLevel) { this.samplingLevel = samplingLevel; this.startPoints = Downsampling.getStartPoints(BASE_SAMPLING_LEVEL, samplingLevel); long maxExpectedEntries = expectedKeys / minIndexInterval; if (maxExpectedEntries > Integer.MAX_VALUE) { // that's a _lot_ of keys, and a very low min index interval int effectiveMinInterval = (int) Math.ceil((double) Integer.MAX_VALUE / expectedKeys); maxExpectedEntries = expectedKeys / effectiveMinInterval; assert maxExpectedEntries <= Integer.MAX_VALUE : maxExpectedEntries; logger.warn("min_index_interval of {} is too low for {} expected keys; using interval of {} instead", minIndexInterval, expectedKeys, effectiveMinInterval); this.minIndexInterval = effectiveMinInterval; } else { this.minIndexInterval = minIndexInterval; } // for initializing data structures, adjust our estimates based on the sampling level maxExpectedEntries = Math.max(1, (maxExpectedEntries * samplingLevel) / BASE_SAMPLING_LEVEL); offsets = new SafeMemoryWriter(4 * maxExpectedEntries).withByteOrder(ByteOrder.nativeOrder()); entries = new SafeMemoryWriter(40 * maxExpectedEntries).withByteOrder(ByteOrder.nativeOrder()); // the summary will always contain the first index entry (downsampling will never remove it) nextSamplePosition = 0; indexIntervalMatches++; }
public IndexSummaryBuilder(long expectedKeys, int minIndexInterval, int samplingLevel) { this.samplingLevel = samplingLevel; this.startPoints = Downsampling.getStartPoints(BASE_SAMPLING_LEVEL, samplingLevel); long maxExpectedEntries = expectedKeys / minIndexInterval; if (maxExpectedEntries > Integer.MAX_VALUE) { // that's a _lot_ of keys, and a very low min index interval int effectiveMinInterval = (int) Math.ceil((double) Integer.MAX_VALUE / expectedKeys); maxExpectedEntries = expectedKeys / effectiveMinInterval; assert maxExpectedEntries <= Integer.MAX_VALUE : maxExpectedEntries; logger.warn("min_index_interval of {} is too low for {} expected keys; using interval of {} instead", minIndexInterval, expectedKeys, effectiveMinInterval); this.minIndexInterval = effectiveMinInterval; } else { this.minIndexInterval = minIndexInterval; } // for initializing data structures, adjust our estimates based on the sampling level maxExpectedEntries = Math.max(1, (maxExpectedEntries * samplingLevel) / BASE_SAMPLING_LEVEL); offsets = new SafeMemoryWriter(4 * maxExpectedEntries).order(ByteOrder.nativeOrder()); entries = new SafeMemoryWriter(40 * maxExpectedEntries).order(ByteOrder.nativeOrder()); // the summary will always contain the first index entry (downsampling will never remove it) nextSamplePosition = 0; indexIntervalMatches++; }
this.startPoints = Downsampling.getStartPoints(BASE_SAMPLING_LEVEL, samplingLevel);
this.startPoints = Downsampling.getStartPoints(BASE_SAMPLING_LEVEL, samplingLevel);
this.startPoints = Downsampling.getStartPoints(BASE_SAMPLING_LEVEL, samplingLevel);
int[] startPoints = Downsampling.getStartPoints(currentSamplingLevel, newSamplingLevel);
int[] startPoints = Downsampling.getStartPoints(currentSamplingLevel, newSamplingLevel);
int[] startPoints = Downsampling.getStartPoints(currentSamplingLevel, newSamplingLevel);
int[] startPoints = Downsampling.getStartPoints(currentSamplingLevel, newSamplingLevel);
int[] startPoints = Downsampling.getStartPoints(currentSamplingLevel, newSamplingLevel);