Package org.roaringbitmap.art
Class Art
- java.lang.Object
-
- org.roaringbitmap.art.Art
-
public class Art extends java.lang.Object
See: https://db.in.tum.de/~leis/papers/ART.pdf a cpu cache friendly main memory data structure. At our case, the LeafNode's key is always 48 bit size. The high 48 bit keys here are compared using the byte dictionary comparison.
-
-
Constructor Summary
Constructors Constructor Description Art()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deserializeArt(java.io.DataInput dataInput)
void
deserializeArt(java.nio.ByteBuffer byteBuffer)
long
findByKey(byte[] key)
long
getKeySize()
Node
getRoot()
void
insert(byte[] key, long containerIdx)
insert the 48 bit key and the corresponding containerIdxboolean
isEmpty()
KeyIterator
iterator(Containers containers)
a convenient method to traverse the key space in ascending order.LeafNodeIterator
leafNodeIterator(boolean reverse, Containers containers)
long
remove(byte[] key)
remove the key from the art if it's there.protected org.roaringbitmap.art.Art.Toolkit
removeSpecifyKey(Node node, byte[] key, int dep)
void
serializeArt(java.io.DataOutput dataOutput)
void
serializeArt(java.nio.ByteBuffer byteBuffer)
long
serializeSizeInBytes()
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
insert
public void insert(byte[] key, long containerIdx)
insert the 48 bit key and the corresponding containerIdx- Parameters:
key
- the high 48 bit of the long datacontainerIdx
- the container index
-
findByKey
public long findByKey(byte[] key)
- Parameters:
key
- the high 48 bit of the long data- Returns:
- the key's corresponding containerIdx
-
iterator
public KeyIterator iterator(Containers containers)
a convenient method to traverse the key space in ascending order.- Parameters:
containers
- input containers- Returns:
- the key iterator
-
remove
public long remove(byte[] key)
remove the key from the art if it's there.- Parameters:
key
- the high 48 bit key- Returns:
- the corresponding containerIdx or -1 indicating not exist
-
removeSpecifyKey
protected org.roaringbitmap.art.Art.Toolkit removeSpecifyKey(Node node, byte[] key, int dep)
-
getRoot
public Node getRoot()
-
serializeArt
public void serializeArt(java.io.DataOutput dataOutput) throws java.io.IOException
- Throws:
java.io.IOException
-
deserializeArt
public void deserializeArt(java.io.DataInput dataInput) throws java.io.IOException
- Throws:
java.io.IOException
-
serializeArt
public void serializeArt(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
- Throws:
java.io.IOException
-
deserializeArt
public void deserializeArt(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
- Throws:
java.io.IOException
-
leafNodeIterator
public LeafNodeIterator leafNodeIterator(boolean reverse, Containers containers)
-
serializeSizeInBytes
public long serializeSizeInBytes()
-
getKeySize
public long getKeySize()
-
-