public class RedBlackTreeStore extends Object implements OffHeapTreeStore
| Constructor and Description |
|---|
RedBlackTreeStore(com.hazelcast.internal.memory.MemoryAllocator malloc,
OffHeapComparator offHeapKeyComparator) |
RedBlackTreeStore(com.hazelcast.internal.memory.MemoryAllocator malloc,
OffHeapComparator offHeapKeyComparator,
boolean disableConsistencyAssertions) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose(boolean releasePayload)
Release of memory (of all keys,values and entries) associated with storage
**WARNING** Special attention is required when disposing a tree this way, if NOT empty.
|
Iterator<OffHeapTreeEntry> |
entries() |
Iterator<OffHeapTreeEntry> |
entries(OffHeapTreeEntry root) |
Iterator<OffHeapTreeEntry> |
entries(OffHeapTreeEntry entry,
OrderingDirection direction) |
Iterator<OffHeapTreeEntry> |
entries(OrderingDirection direction) |
OffHeapTreeEntry |
getEntry(com.hazelcast.internal.serialization.impl.HeapData key)
Looking for key equal to blob;
|
OffHeapTreeEntry |
getEntry(MemoryBlock key)
Looking for key equal to blob;
|
OffHeapTreeEntry |
getEntry(MemoryBlock key,
OffHeapComparator comparator)
Looking for key equal to blob using the given comparator;
In case if not-found - if createIfNotExists==true - create new key entry;
if createIfNotExists==false - don't create new key entry - return null;
|
Iterator<OffHeapTreeEntry> |
iterator() |
OffHeapTreeEntry |
put(MemoryBlock key,
MemoryBlock value)
Looking for key equal to blob;
In case if found - append value represented by value to the chain of key's values;
In case if not-found - adds new key to the corresponding place in the tree and assign value to this 'new' key;
|
OffHeapTreeEntry |
put(MemoryBlock key,
MemoryBlock value,
OffHeapComparator comparator) |
void |
remove(OffHeapTreeEntry entry)
Removes the entry from the tree and disposes used space associated with that entry
including Key and Value blobs.
|
OffHeapTreeEntry |
searchEntry(MemoryBlock key)
Looking for key equal or closest to blob;
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic RedBlackTreeStore(com.hazelcast.internal.memory.MemoryAllocator malloc,
OffHeapComparator offHeapKeyComparator)
public RedBlackTreeStore(com.hazelcast.internal.memory.MemoryAllocator malloc,
OffHeapComparator offHeapKeyComparator,
boolean disableConsistencyAssertions)
public OffHeapTreeEntry put(MemoryBlock key, MemoryBlock value)
OffHeapTreeStoreput in interface OffHeapTreeStorekey - - The key blob;value - - The value blob;public OffHeapTreeEntry put(MemoryBlock key, MemoryBlock value, OffHeapComparator comparator)
public OffHeapTreeEntry getEntry(MemoryBlock key)
OffHeapTreeStoregetEntry in interface OffHeapTreeStorekey - - The key blob;null if not foundpublic OffHeapTreeEntry getEntry(com.hazelcast.internal.serialization.impl.HeapData key)
OffHeapTreeStoregetEntry in interface OffHeapTreeStorekey - - The key blob;null if not foundpublic OffHeapTreeEntry getEntry(MemoryBlock key, OffHeapComparator comparator)
OffHeapTreeStoregetEntry in interface OffHeapTreeStorekey - - The key blob;comparator - - comparator to be used, if null default passed in constructor will be usedpublic OffHeapTreeEntry searchEntry(MemoryBlock key)
OffHeapTreeStoresearchEntry in interface OffHeapTreeStorekey - - The key blob;public void dispose(boolean releasePayload)
OffHeapTreeStoredispose in interface OffHeapTreeStorepublic void remove(OffHeapTreeEntry entry)
OffHeapTreeStoreOffHeapTreeStore.getEntry(MemoryBlock) and dispose the allocated chunks on
the addresses of the returned Entry Key & Values. Eg.
OffHeapTreeEntry entry = getEntry(...);
dispose(entry.getKey());
for (MemoryBlock value : entry) {
dispose(value);
}
remove(entry);
remove in interface OffHeapTreeStoreentry - The tree entry to be removedpublic Iterator<OffHeapTreeEntry> iterator()
iterator in interface Iterable<OffHeapTreeEntry>public Iterator<OffHeapTreeEntry> entries()
entries in interface OffHeapTreeStorepublic Iterator<OffHeapTreeEntry> entries(OrderingDirection direction)
entries in interface OffHeapTreeStorepublic Iterator<OffHeapTreeEntry> entries(OffHeapTreeEntry root)
entries in interface OffHeapTreeStorepublic Iterator<OffHeapTreeEntry> entries(OffHeapTreeEntry entry, OrderingDirection direction)
entries in interface OffHeapTreeStoreCopyright © 2022 Hazelcast, Inc.. All Rights Reserved.