public class IBSkipSpan<K extends Comparable<? super K>,V> extends BSkipSpan<K,V>
bf, CONT_HEADER_LEN, HEADER_LEN, isKilled, keySer, MAGIC, nextPage, overflowPage, page, prevPage, spanSize, valSer
Constructor and Description |
---|
IBSkipSpan(BlockFile bf,
BSkipList<K,V> bsl,
int spanPage,
Serializer<K> key,
Serializer<V> val) |
Modifier and Type | Method and Description |
---|---|
K |
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
|
V |
get(K key)
Linear search if in file, Binary search if in memory
|
SkipSpan<K,V> |
getSpan(K 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<K,V> |
newInstance(SkipList<K,V> sl) |
SkipSpan<K,V> |
put(K key,
V val,
SkipList<K,V> sl)
Load whole span from file, do the operation, flush out, then null out in-memory data again.
|
Object[] |
remove(K key,
SkipList<K,V> 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<K,V> bsl, int spanPage, Serializer<K> key, Serializer<V> val) throws IOException
IOException
public SkipSpan<K,V> newInstance(SkipList<K,V> sl)
newInstance
in class BSkipSpan<K extends Comparable<? super K>,V>
public void flush()
protected void loadData() throws IOException
loadData
in class BSkipSpan<K extends Comparable<? super K>,V>
IOException
void seekAndLoadData() throws IOException
IOException
public K firstKey()
public SkipSpan<K,V> getSpan(K key, int[] search)
public SkipSpan<K,V> put(K key, V val, SkipList<K,V> sl)