Package net.metanotion.io.block.index
Class BSkipLevels<K extends Comparable<? super K>,V>
- java.lang.Object
-
- net.metanotion.util.skiplist.SkipLevels<K,V>
-
- net.metanotion.io.block.index.BSkipLevels<K,V>
-
- All Implemented Interfaces:
Flushable
public class BSkipLevels<K extends Comparable<? super K>,V> extends SkipLevels<K,V>
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.
-
-
Field Summary
Fields Modifier and Type Field Description BlockFile
bf
(package private) static int
HEADER_LEN
int
levelPage
int
spanPage
-
Fields inherited from class net.metanotion.util.skiplist.SkipLevels
bottom, levels, MAX_SIZE
-
-
Constructor Summary
Constructors Constructor Description BSkipLevels(BlockFile bf, int levelPage, BSkipList<K,V> 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
blvlck(boolean fix)
Run an integrity check on the skiplevels from the first, or just fix it if fix == true.boolean
blvlck(boolean fix, int width, SkipLevels<K,V>[] prevLevels)
void
flush()
static void
init(BlockFile bf, int page, int spanPage, int maxHeight)
void
initializeLevels()
Non-recursive initializer.void
killInstance()
SkipLevels<K,V>
newInstance(int levels, SkipSpan<K,V> ss, SkipList<K,V> sl)
String
toString()
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
BSkipLevels
public BSkipLevels(BlockFile bf, int levelPage, BSkipList<K,V> 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
-
-
Method Detail
-
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 interfaceFlushable
- Overrides:
flush
in classSkipLevels<K extends Comparable<? super K>,V>
-
killInstance
public void killInstance()
- Overrides:
killInstance
in classSkipLevels<K extends Comparable<? super K>,V>
-
newInstance
public SkipLevels<K,V> newInstance(int levels, SkipSpan<K,V> ss, SkipList<K,V> sl)
- Overrides:
newInstance
in classSkipLevels<K extends Comparable<? super K>,V>
-
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 classSkipLevels<K extends Comparable<? super K>,V>
- Returns:
- true if the levels were modified.
-
blvlck
public boolean blvlck(boolean fix, int width, SkipLevels<K,V>[] prevLevels)
- Overrides:
blvlck
in classSkipLevels<K extends Comparable<? super K>,V>
-
-