
public class OSBTreeBonsaiLocal<K,V> extends ODurableComponent implements OSBTreeBonsai<K,V>
OSBTree but uses subpages of disk cache that is more efficient for small data
structures.
Oriented for usage of several instances inside of one file.
Creation of several instances that represent the same collection is not allowed.
OSBTreeOTreeInternal.AccumulativeListener<K,V>, OTreeInternal.RangeResultListener<K,V>atomicOperationsManager, extension, performanceStatisticManager, readCache, storage, writeCache| Constructor and Description |
|---|
OSBTreeBonsaiLocal(String name,
String dataFileExtension,
OAbstractPaginatedStorage storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all entries from bonsai tree.
|
void |
close() |
void |
close(boolean flush) |
void |
create(OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer) |
void |
debugPrintBucket(OBonsaiBucketPointer bucketPointer,
PrintStream writer,
ArrayList<OBonsaiBucketPointer> path) |
void |
debugPrintBucket(PrintStream writer) |
void |
delete()
Deletes a whole tree.
|
K |
firstKey() |
void |
flush() |
V |
get(K key)
Search for entry with specific key and return its value.
|
OBonsaiCollectionPointer |
getCollectionPointer() |
long |
getFileId()
Gets id of file where this bonsai tree is stored.
|
OBinarySerializer<K> |
getKeySerializer() |
int |
getRealBagSize(Map<K,OSBTreeRidBag.Change> changes)
Hardcoded method for Bag to avoid creation of extra layer.
|
OBonsaiBucketPointer |
getRootBucketPointer() |
Collection<V> |
getValuesBetween(K keyFrom,
boolean fromInclusive,
K keyTo,
boolean toInclusive,
int maxValuesToFetch) |
OBinarySerializer<V> |
getValueSerializer() |
Collection<V> |
getValuesMajor(K key,
boolean inclusive,
int maxValuesToFetch) |
Collection<V> |
getValuesMinor(K key,
boolean inclusive,
int maxValuesToFetch) |
K |
lastKey() |
boolean |
load(OBonsaiBucketPointer rootBucketPointer) |
void |
loadEntriesBetween(K keyFrom,
boolean fromInclusive,
K keyTo,
boolean toInclusive,
OTreeInternal.RangeResultListener<K,V> listener) |
void |
loadEntriesMajor(K key,
boolean inclusive,
boolean ascSortOrder,
OTreeInternal.RangeResultListener<K,V> listener)
Load all entries with key greater then specified key.
|
void |
loadEntriesMinor(K key,
boolean inclusive,
OTreeInternal.RangeResultListener<K,V> listener) |
boolean |
put(K key,
V value) |
V |
remove(K key) |
long |
size() |
protected void |
startOperation() |
acquireExclusiveLock, addFile, addPage, completeOperation, deleteFile, endAtomicOperation, getChanges, getExtension, getFilledUpTo, getFullName, getLockName, getName, isFileExists, isFileExists, loadPage, loadPage, openFile, pinPage, releasePage, setName, startAtomicOperation, truncateFileacquireSharedLock, addUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, releaseExclusiveLock, releaseSharedLock, removeUser, tryAcquireExclusiveLock, tryAcquireSharedLockpublic OSBTreeBonsaiLocal(String name, String dataFileExtension, OAbstractPaginatedStorage storage)
public void create(OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer)
public long getFileId()
OSBTreeBonsaigetFileId in interface OSBTreeBonsai<K,V>OReadCachepublic OBonsaiBucketPointer getRootBucketPointer()
getRootBucketPointer in interface OSBTreeBonsai<K,V>public OBonsaiCollectionPointer getCollectionPointer()
getCollectionPointer in interface OSBTreeBonsai<K,V>public V get(K key)
OSBTreeBonsaiget in interface OSBTreeBonsai<K,V>public void close(boolean flush)
public void close()
public void clear()
clear in interface OSBTreeBonsai<K,V>public void delete()
delete in interface OSBTreeBonsai<K,V>public boolean load(OBonsaiBucketPointer rootBucketPointer)
public long size()
size in interface OTreeInternal<K,V>size in interface OSBTreeBonsai<K,V>public V remove(K key)
remove in interface OTreeInternal<K,V>remove in interface OSBTreeBonsai<K,V>public Collection<V> getValuesMinor(K key, boolean inclusive, int maxValuesToFetch)
getValuesMinor in interface OSBTreeBonsai<K,V>public void loadEntriesMinor(K key, boolean inclusive, OTreeInternal.RangeResultListener<K,V> listener)
loadEntriesMinor in interface OSBTreeBonsai<K,V>public Collection<V> getValuesMajor(K key, boolean inclusive, int maxValuesToFetch)
getValuesMajor in interface OSBTreeBonsai<K,V>public void loadEntriesMajor(K key, boolean inclusive, boolean ascSortOrder, OTreeInternal.RangeResultListener<K,V> listener)
loadEntriesMajor in interface OTreeInternal<K,V>loadEntriesMajor in interface OSBTreeBonsai<K,V>key - definesinclusive - if true entry with given key is includedascSortOrder - listener - public Collection<V> getValuesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, int maxValuesToFetch)
getValuesBetween in interface OSBTreeBonsai<K,V>public K firstKey()
firstKey in interface OTreeInternal<K,V>firstKey in interface OSBTreeBonsai<K,V>public K lastKey()
lastKey in interface OSBTreeBonsai<K,V>public void loadEntriesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, OTreeInternal.RangeResultListener<K,V> listener)
loadEntriesBetween in interface OSBTreeBonsai<K,V>public void flush()
public int getRealBagSize(Map<K,OSBTreeRidBag.Change> changes)
OSBTreeBonsaigetRealBagSize in interface OSBTreeBonsai<K,V>changes - Bag changespublic OBinarySerializer<K> getKeySerializer()
getKeySerializer in interface OSBTreeBonsai<K,V>public OBinarySerializer<V> getValueSerializer()
getValueSerializer in interface OSBTreeBonsai<K,V>public void debugPrintBucket(PrintStream writer) throws IOException
IOExceptionpublic void debugPrintBucket(OBonsaiBucketPointer bucketPointer, PrintStream writer, ArrayList<OBonsaiBucketPointer> path) throws IOException
IOExceptionprotected void startOperation()
startOperation in class ODurableComponentCopyright © 2009–2025 OrientDB. All rights reserved.