
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, readCache, storage, writeCache| Constructor and Description |
|---|
OSBTreeBonsaiLocal(String name,
String dataFileExtension,
OAbstractPaginatedStorage storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(OAtomicOperation atomicOperation)
Removes all entries from bonsai tree.
|
void |
close() |
void |
close(boolean flush) |
void |
create(OAtomicOperation atomicOperation,
OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer) |
void |
debugPrintBucket(PrintStream writer) |
void |
delete(OAtomicOperation atomicOperation)
Deletes a whole tree.
|
K |
firstKey() |
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,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) |
void |
markToDelete(OAtomicOperation atomicOperation) |
boolean |
put(OAtomicOperation atomicOperation,
K key,
V value) |
V |
remove(OAtomicOperation atomicOperation,
K key) |
long |
size() |
boolean |
tryDelete(OAtomicOperation atomicOperation) |
addFile, addPage, calculateInsideComponentOperation, deleteFile, executeInsideComponentOperation, getExtension, getFilledUpTo, getFullName, getLockName, getName, isFileExists, loadPageForRead, loadPageForRead, loadPageForWrite, openFile, pinPage, releasePageFromRead, releasePageFromWrite, setName, truncateFile, tryExecuteInsideComponentOperationacquireExclusiveLock, acquireSharedLock, addUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, releaseExclusiveLock, releaseSharedLock, removeUser, tryAcquireExclusiveLock, tryAcquireSharedLockpublic OSBTreeBonsaiLocal(String name, String dataFileExtension, OAbstractPaginatedStorage storage)
public void create(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer) throws IOException
IOExceptionpublic 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 boolean put(OAtomicOperation atomicOperation, K key, V value)
put in interface OSBTreeBonsai<K,V>public void close(boolean flush)
public void close()
public void clear(OAtomicOperation atomicOperation)
clear in interface OSBTreeBonsai<K,V>public void delete(OAtomicOperation atomicOperation) throws IOException
delete in interface OSBTreeBonsai<K,V>IOExceptionpublic boolean tryDelete(OAtomicOperation atomicOperation)
public boolean load(OBonsaiBucketPointer rootBucketPointer)
public long size()
size in interface OTreeInternal<K,V>size in interface OSBTreeBonsai<K,V>public V remove(OAtomicOperation atomicOperation, 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 includedpublic 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 int getRealBagSize(Map<K,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 markToDelete(OAtomicOperation atomicOperation)
markToDelete in interface OSBTreeBonsai<K,V>Copyright © 2009–2025 OrientDB. All rights reserved.