net.metanotion.io.block.index
Class BSkipLevels
java.lang.Object
net.metanotion.util.skiplist.SkipLevels
net.metanotion.io.block.index.BSkipLevels
- All Implemented Interfaces:
- Flushable
public class BSkipLevels
- extends SkipLevels
On-disk format:
Magic number (long)
max height (unsigned short)
non-null height (unsigned short)
span page (unsigned int)
height number of level pages (unsigned ints)
Always fits on one page.
Constructor Summary |
BSkipLevels(BlockFile bf,
int levelPage,
BSkipList bsl)
Non-recursive initializer initializeLevels()
MUST be called on the first BSkipLevel in the skiplist
after the constructor, unless it's a new empty
level and init() was previously called. |
HEADER_LEN
static final int HEADER_LEN
- See Also:
- Constant Field Values
levelPage
public final int levelPage
spanPage
public final int spanPage
bf
public final BlockFile bf
BSkipLevels
public BSkipLevels(BlockFile bf,
int levelPage,
BSkipList bsl)
throws IOException
- Non-recursive initializer initializeLevels()
MUST be called on the first BSkipLevel in the skiplist
after the constructor, unless it's a new empty
level and init() was previously called.
- Throws:
IOException
initializeLevels
public void initializeLevels()
- Non-recursive initializer.
MUST be called on the first BSkipLevel in the skiplist
after the constructor, unless it's a new empty
level and init() was previously called.
Only call on the first skiplevel in the list!
- Since:
- 0.9.20
init
public static void init(BlockFile bf,
int page,
int spanPage,
int maxHeight)
throws IOException
- Throws:
IOException
flush
public void flush()
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class SkipLevels
killInstance
public void killInstance()
- Overrides:
killInstance
in class SkipLevels
newInstance
public SkipLevels newInstance(int levels,
SkipSpan ss,
SkipList sl)
- Overrides:
newInstance
in class SkipLevels
blvlck
public boolean blvlck(boolean fix)
- Run an integrity check on the skiplevels from the first,
or just fix it if fix == true.
Only call from the first level.
- Overrides:
blvlck
in class SkipLevels
- Returns:
- true if the levels were modified.
blvlck
public boolean blvlck(boolean fix,
int width,
SkipLevels[] prevLevels)
- Overrides:
blvlck
in class SkipLevels
toString
public String toString()
- Overrides:
toString
in class Object