Package net.metanotion.io.block.index
Class BSkipList<K extends Comparable<? super K>,V>
java.lang.Object
net.metanotion.util.skiplist.SkipList<K,V>
net.metanotion.io.block.index.BSkipList<K,V>
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,Iterable<V>
public class BSkipList<K extends Comparable<? super K>,V> extends SkipList<K,V> implements Closeable
On-disk format:
Magic number (long) first span page (unsigned int) first level page (unsigned int) size (unsigned int) spans (unsigned int) levels (unsigned int)Always fits on one page.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BSkipList(int spanSize, BlockFile bf, int skipPage, Serializer<K> key, Serializer<V> val)
BSkipList(int spanSize, BlockFile bf, int skipPage, Serializer<K> key, Serializer<V> val, boolean fileOnly)
-
Method Summary
Modifier and Type Method Description boolean
bslck(boolean fix, boolean isMeta)
Run an integrity check on the skiplist and all the levels in itvoid
close()
void
delete()
must be open (do not call close() first)SkipIterator<K,V>
find(K key)
findvoid
flush()
static void
init(BlockFile bf, int page, int spanSize)
SkipIterator<K,V>
iterator()
int
maxLevels()
String
toString()
Methods inherited from class net.metanotion.util.skiplist.SkipList
addItem, balance, delItem, generateColHeight, get, print, printSL, put, remove, size
-
Field Details
-
firstSpanPage
public int firstSpanPage -
firstLevelPage
public int firstLevelPage -
skipPage
public int skipPage -
bf
-
spanHash
-
levelHash
-
-
Constructor Details
-
BSkipList
public BSkipList(int spanSize, BlockFile bf, int skipPage, Serializer<K> key, Serializer<V> val) throws IOException- Throws:
IOException
-
BSkipList
public BSkipList(int spanSize, BlockFile bf, int skipPage, Serializer<K> key, Serializer<V> val, boolean fileOnly) throws IOException- Throws:
IOException
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
flush
public void flush() -
delete
must be open (do not call close() first)- Throws:
IOException
-
init
- Throws:
IOException
-
maxLevels
public int maxLevels() -
iterator
-
find
find -
bslck
public boolean bslck(boolean fix, boolean isMeta)Run an integrity check on the skiplist and all the levels in it- Returns:
- true if the levels were modified.
-
toString
-