com.comcast.xfinity.sirius.uberstore.seqindex
{ Close open file handles.
{ Close open file handles. This SeqIndex should not be used after close is called. }
{ Get the maximum sequence number stored, if such exists
{ Get the maximum sequence number stored, if such exists
}
Some(sequence) or None if none such exists
{ Get the offset for a particular sequence number
{ Get the offset for a particular sequence number
}
Some(offset) if found, None if not
{ Get the range of offsets for entries for sequence numbers between firstSeq and lastSeq, inclusive.
{ Get the range of offsets for entries for sequence numbers between firstSeq and lastSeq, inclusive.
}
first sequence number to look for
last sequence number to look for
Tuple2[Long, Long] with the first item being the offset of the first entry withing. If the range is empty, (0, -1) is returned
Returns whether or not index is closed for use.
Returns whether or not index is closed for use. Closed indexes should not be used.
true if index is closed, false otherwise
{ Map seq -> offset, persisting to disk and memory
{ Map seq -> offset, persisting to disk and memory
This operation is not thread safe relative to other put operations.
Subsequent Seq/Offset pairs should be strictly increasing, for now behavior is undefined if they are not, in the future we may enforce this more vigorously.ugh
}
sequence number
offset
Returns the segment size.
Returns the segment size. If the index is empty then the size is 0.
the size of the segment as a Long
UberStore SeqIndex implementation that has next to no memory overhead at the expense of relying heavily on disk operations. This implementation should play well with the file system cache, which probably does a better job than anything we could put together at the JVM level, so disk operations shouldn't be too terrible.
Offset lookups are done using an on disk binary search.