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.
-
-
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
All Methods Static Methods Instance Methods Concrete Methods 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
firstSpanPage
public int firstSpanPage
-
firstLevelPage
public int firstLevelPage
-
skipPage
public int skipPage
-
bf
public final BlockFile bf
-
levelHash
final HashMap<Integer,SkipLevels<K extends Comparable<? super K>,V>> levelHash
-
-
Constructor Detail
-
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 Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
flush
public void flush()
-
delete
public void delete() throws IOException
must be open (do not call close() first)- Throws:
IOException
-
init
public static void init(BlockFile bf, int page, int spanSize) throws IOException
- Throws:
IOException
-
maxLevels
public int maxLevels()
-
iterator
public SkipIterator<K,V> iterator()
-
find
public SkipIterator<K,V> find(K key)
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.
-
-