Class DoubleReverseSegmentedSortedArray

java.lang.Object
com.illumon.iris.db.v2.ssa.DoubleReverseSegmentedSortedArray
All Implemented Interfaces:
LongSizedDataStructure, SegmentedSortedArray

public final class DoubleReverseSegmentedSortedArray extends Object implements SegmentedSortedArray
For keeping track of incremental states of sorted values, we would ideally like to hold them in an Array or a Chunk; with parallel index keys. However, if we just put them in an array we can not insert or remove values without unnecessarily shifting everything. The segmented array allows us to either insert or remove elements and only shift values in a "leaf" block and possibly a "directory" block. It can be thought of as similar to a single-level b+ tree with only keys. We must be totally ordered, which is accomplished by sorting on the double values, and then on the corresponding index key.