Package com.arcadedb.index
Class CompressedAny2RIDIndex<K>
- java.lang.Object
-
- com.arcadedb.index.CompressedAny2RIDIndex<K>
-
public class CompressedAny2RIDIndex<K> extends Object
Map like optimized to avoid stressing the GC by using mechanical sympathy technique + compression of key and values. This class is synchronized. Values are RIDs, key can be anything. This Map implementation doesn't support to overwrite a value. Values cannot be null.
A Binary object is used to store the hash table (the first part of it) and then keys and values. The key is serialized in the position pointed by the hash table, then a fixed-size integer containing the next entry (with the same hash) and after that the compressed RID.TODO support up to 4GB by using unsigned int
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CompressedAny2RIDIndex.EntryIterator
-
Constructor Summary
Constructors Constructor Description CompressedAny2RIDIndex(Database database, Type keyType, int expectedSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object key)
RID
get(Binary threadBuffer, Object key)
RID
get(Object key)
int
getChunkAllocated()
int
getChunkSize()
Binary
getInternalBuffer()
Type
getKeyBinaryType()
int
getTotalUsedSlots()
boolean
isEmpty()
void
put(K key, RID value)
int
size()
CompressedAny2RIDIndex.EntryIterator
vertexIterator()
-
-
-
Constructor Detail
-
CompressedAny2RIDIndex
public CompressedAny2RIDIndex(Database database, Type keyType, int expectedSize) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
-
Method Detail
-
getKeyBinaryType
public Type getKeyBinaryType()
-
vertexIterator
public CompressedAny2RIDIndex.EntryIterator vertexIterator()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
-
getChunkSize
public int getChunkSize()
-
getChunkAllocated
public int getChunkAllocated()
-
getTotalUsedSlots
public int getTotalUsedSlots()
-
getInternalBuffer
public Binary getInternalBuffer()
-
-