net.metanotion.io.block.index
public class BSkipSpan extends SkipSpan
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 |
keySer |
protected static int |
MAGIC |
protected int |
nextPage |
protected int |
overflowPage |
protected int |
page |
protected int |
prevPage |
protected int |
spanSize |
protected Serializer |
valSer |
Modifier | Constructor and Description |
---|---|
protected |
BSkipSpan(BlockFile bf,
BSkipList bsl) |
|
BSkipSpan(BlockFile bf,
BSkipList bsl,
int spanPage,
Serializer key,
Serializer 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 void |
loadInit(BSkipSpan bss,
BlockFile bf,
BSkipList bsl,
int spanPage,
Serializer key,
Serializer 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 |
newInstance(SkipList 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 keySer
protected Serializer valSer
protected int spanSize
protected boolean isKilled
public BSkipSpan(BlockFile bf, BSkipList bsl, int spanPage, Serializer key, Serializer val) throws IOException
IOException
public static void init(BlockFile bf, int page, int spanSize) throws IOException
IOException
public SkipSpan newInstance(SkipList sl)
newInstance
in class SkipSpan
public void killInstance()
killInstance
in class SkipSpan
protected static void loadInit(BSkipSpan bss, BlockFile bf, BSkipList bsl, int spanPage, Serializer key, Serializer 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)