public class BSkipSpan<K extends Comparable<? super K>,V> extends SkipSpan<K,V>
First Page: Magic number (int) overflow page (unsigned int) previous page (unsigned int) next page (unsigned int) max keys (unsigned short) number of keys (unsigned short) for each key: key length (unsigned short) value length (unsigned short) key data value data Overflow pages: Magic number (int) next overflow page (unsigned int)
Modifier and Type | Field and Description |
---|---|
protected BlockFile |
bf |
static int |
CONT_HEADER_LEN |
protected static int |
HEADER_LEN |
protected boolean |
isKilled |
protected Serializer<K> |
keySer |
protected static int |
MAGIC |
protected int |
nextPage |
protected int |
overflowPage |
protected int |
page |
protected int |
prevPage |
protected int |
spanSize |
protected Serializer<V> |
valSer |
Modifier | Constructor and Description |
---|---|
protected |
BSkipSpan(BlockFile bf,
BSkipList<K,V> bsl) |
|
BSkipSpan(BlockFile bf,
BSkipList<K,V> bsl,
int spanPage,
Serializer<K> key,
Serializer<V> val) |
Modifier and Type | Method and Description |
---|---|
void |
flush() |
static void |
init(BlockFile bf,
int page,
int spanSize) |
void |
killInstance() |
protected void |
loadData()
I2P - second half of load()
Load the whole span's keys and values into memory
|
protected void |
loadData(boolean flushOnError)
I2P - second half of load()
Load the whole span's keys and values into memory
|
protected static <X extends Comparable<? super X>,Y> |
loadInit(BSkipSpan<X,Y> bss,
BlockFile bf,
BSkipList<X,Y> bsl,
int spanPage,
Serializer<X> key,
Serializer<Y> val)
I2P - first half of load()
Only read the span headers
|
protected void |
lostEntries(int firstBadEntry,
int lastGoodPage)
Attempt to recover from corrupt data in this span.
|
SkipSpan<K,V> |
newInstance(SkipList<K,V> sl) |
String |
toString() |
protected static final int MAGIC
protected static final int HEADER_LEN
public static final int CONT_HEADER_LEN
protected final BlockFile bf
protected int page
protected int overflowPage
protected int prevPage
protected int nextPage
protected Serializer<K extends Comparable<? super K>> keySer
protected Serializer<V> valSer
protected int spanSize
protected boolean isKilled
public BSkipSpan(BlockFile bf, BSkipList<K,V> bsl, int spanPage, Serializer<K> key, Serializer<V> val) throws IOException
IOException
public static void init(BlockFile bf, int page, int spanSize) throws IOException
IOException
public SkipSpan<K,V> newInstance(SkipList<K,V> sl)
newInstance
in class SkipSpan<K extends Comparable<? super K>,V>
public void killInstance()
killInstance
in class SkipSpan<K extends Comparable<? super K>,V>
public void flush()
protected static <X extends Comparable<? super X>,Y> void loadInit(BSkipSpan<X,Y> bss, BlockFile bf, BSkipList<X,Y> bsl, int spanPage, Serializer<X> key, Serializer<Y> val) throws IOException
IOException
protected void loadData() throws IOException
IOException
protected void loadData(boolean flushOnError) throws IOException
flushOnError
- set to false if you are going to flush anywayIOException
protected void lostEntries(int firstBadEntry, int lastGoodPage)