/** * Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this * returns the number of partitions in the primary on-disk index before the next partition that has an entry in * the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval. * @param index an index into an IndexSummary * @param samplingLevel the current sampling level for that IndexSummary * @param minIndexInterval the min index interval (effective index interval at full sampling) * @return the number of partitions before the next index summary entry, inclusive on one end */ public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1) ? BASE_SAMPLING_LEVEL : originalIndexes.get(index + 1); return (nextEntryOriginalIndex - originalIndexes.get(index)) * minIndexInterval; }
/** * Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this * returns the number of partitions in the primary on-disk index before the next partition that has an entry in * the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval. * @param index an index into an IndexSummary * @param samplingLevel the current sampling level for that IndexSummary * @param minIndexInterval the min index interval (effective index interval at full sampling) * @return the number of partitions before the next index summary entry, inclusive on one end */ public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1) ? BASE_SAMPLING_LEVEL : originalIndexes.get(index + 1); return (nextEntryOriginalIndex - originalIndexes.get(index)) * minIndexInterval; }
/** * Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this * returns the number of partitions in the primary on-disk index before the next partition that has an entry in * the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval. * @param index an index into an IndexSummary * @param samplingLevel the current sampling level for that IndexSummary * @param minIndexInterval the min index interval (effective index interval at full sampling) * @return the number of partitions before the next index summary entry, inclusive on one end */ public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1) ? BASE_SAMPLING_LEVEL : originalIndexes.get(index + 1); return (nextEntryOriginalIndex - originalIndexes.get(index)) * minIndexInterval; }
/** * Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this * returns the number of partitions in the primary on-disk index before the next partition that has an entry in * the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval. * @param index an index into an IndexSummary * @param samplingLevel the current sampling level for that IndexSummary * @param minIndexInterval the min index interval (effective index interval at full sampling) * @return the number of partitions before the next index summary entry, inclusive on one end */ public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1) ? BASE_SAMPLING_LEVEL : originalIndexes.get(index + 1); return (nextEntryOriginalIndex - originalIndexes.get(index)) * minIndexInterval; }
/** * Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this * returns the number of partitions in the primary on-disk index before the next partition that has an entry in * the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval. * @param index an index into an IndexSummary * @param samplingLevel the current sampling level for that IndexSummary * @param minIndexInterval the min index interval (effective index interval at full sampling) * @return the number of partitions before the next index summary entry, inclusive on one end */ public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1) ? BASE_SAMPLING_LEVEL : originalIndexes.get(index + 1); return (nextEntryOriginalIndex - originalIndexes.get(index)) * minIndexInterval; }