public class IBSkipSpan extends BSkipSpan
bf, CONT_HEADER_LEN, HEADER_LEN, isKilled, keySer, MAGIC, nextPage, overflowPage, page, prevPage, spanSize, valSer
Constructor and Description |
---|
IBSkipSpan(BlockFile bf,
BSkipList bsl,
int spanPage,
Serializer key,
Serializer val) |
Modifier and Type | Method and Description |
---|---|
Comparable |
firstKey()
Does not call super, we always store first key here
|
void |
flush()
Flush to disk and null out in-memory keys and values, saving only the first key
|
Object |
get(Comparable key)
Linear search if in file, Binary search if in memory
|
SkipSpan |
getSpan(Comparable key,
int[] search)
Load whole span from file, do the operation, flush out, then null out in-memory data again.
|
protected void |
loadData()
I2P - second half of load()
Load the whole span's keys and values into memory
|
SkipSpan |
newInstance(SkipList sl) |
SkipSpan |
put(Comparable key,
Object val,
SkipList sl)
Load whole span from file, do the operation, flush out, then null out in-memory data again.
|
Object[] |
remove(Comparable key,
SkipList sl)
Load whole span from file, do the operation, flush out, then null out in-memory data again.
|
(package private) void |
seekAndLoadData()
Seek to the start of the span and load the data
Package private so BSkipIterator can call it
|
init, killInstance, loadData, loadInit, lostEntries, toString
public IBSkipSpan(BlockFile bf, BSkipList bsl, int spanPage, Serializer key, Serializer val) throws IOException
IOException
public SkipSpan newInstance(SkipList sl)
newInstance
in class BSkipSpan
public void flush()
protected void loadData() throws IOException
loadData
in class BSkipSpan
IOException
void seekAndLoadData() throws IOException
IOException
public Comparable firstKey()
public SkipSpan getSpan(Comparable key, int[] search)
public Object get(Comparable key)
public SkipSpan put(Comparable key, Object val, SkipList sl)
public Object[] remove(Comparable key, SkipList sl)