Interface OSBTreeBonsai<K,V>
- All Superinterfaces:
OTreeInternal<K,V>
- All Known Implementing Classes:
BTreeBonsaiGlobal,OSBTreeBonsaiLocal
The tree that have similar structure to
The tree algorithm is the same as in
The
OSBTreeV1 and designed to store small entries.
The tree algorithm is the same as in
OSBTreeV1, but it have tiny buckets.The
OReadCache could contain several buckets. That's why there is no huge resource
consuming when you have lots of OSBTreeBonsai that contain only few records.
+--------------------------------------------------------------------------------------------+
| DISK CACHE PAGE |
|+---------------+ +---------------+ +---------------+ +---------------+ +---------------+ |
|| Bonsai Bucket | | Bonsai Bucket | | Bonsai Bucket | | Bonsai Bucket | | Bonsai Bucket |...|
|+---------------+ +---------------+ +---------------+ +---------------+ +---------------+ |
+--------------------------------------------------------------------------------------------+
- Since:
- 1.7rc1
- Author:
- Artem Orobets (enisher-at-gmail.com)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.storage.index.sbtree.OTreeInternal
OTreeInternal.AccumulativeListener<K,V>, OTreeInternal.RangeResultListener<K, V> -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(OAtomicOperation atomicOperation) Deletes all entries from tree.voiddelete(OAtomicOperation atomicOperation) Deletes whole tree.firstKey()Search for entry with specific key and return its value.longGets id of file where this bonsai tree is stored.intgetRealBagSize(Map<K, Change> changes) Hardcoded method for Bag to avoid creation of extra layer.getValuesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, int maxValuesToFetch) getValuesMajor(K key, boolean inclusive, int maxValuesToFetch) getValuesMinor(K key, boolean inclusive, int maxValuesToFetch) booleanisEmpty()lastKey()voidloadEntriesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, OTreeInternal.RangeResultListener<K, V> listener) voidloadEntriesMajor(K key, boolean inclusive, boolean ascSortOrder, OTreeInternal.RangeResultListener<K, V> listener) voidloadEntriesMinor(K key, boolean inclusive, OTreeInternal.RangeResultListener<K, V> listener) booleanput(OAtomicOperation atomicOperation, K key, V value) remove(OAtomicOperation atomicOperation, K key)
-
Method Details
-
getFileId
long getFileId()Gets id of file where this bonsai tree is stored.- Returns:
- id of file in
OReadCache
-
getRootBucketPointer
OBonsaiBucketPointer getRootBucketPointer()- Returns:
- the pointer to the root bucket in tree.
-
getCollectionPointer
OBonsaiCollectionPointer getCollectionPointer()- Returns:
- pointer to a collection.
-
get
Search for entry with specific key and return its value.- Parameters:
key-- Returns:
- value associated with given key, NULL if no value is associated.
-
put
- Throws:
IOException
-
clear
Deletes all entries from tree.- Parameters:
atomicOperation-- Throws:
IOException
-
delete
Deletes whole tree. After this operation tree is no longer usable.- Parameters:
atomicOperation-
-
isEmpty
boolean isEmpty()- Specified by:
isEmptyin interfaceOTreeInternal<K,V>
-
remove
- Specified by:
removein interfaceOTreeInternal<K,V> - Throws:
IOException
-
getValuesMinor
-
loadEntriesMinor
-
getValuesMajor
-
loadEntriesMajor
void loadEntriesMajor(K key, boolean inclusive, boolean ascSortOrder, OTreeInternal.RangeResultListener<K, V> listener) - Specified by:
loadEntriesMajorin interfaceOTreeInternal<K,V>
-
getValuesBetween
Collection<V> getValuesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, int maxValuesToFetch) -
firstKey
K firstKey()- Specified by:
firstKeyin interfaceOTreeInternal<K,V>
-
lastKey
K lastKey() -
loadEntriesBetween
void loadEntriesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, OTreeInternal.RangeResultListener<K, V> listener) -
getRealBagSize
Hardcoded method for Bag to avoid creation of extra layer.Don't make any changes to tree.
- Parameters:
changes- Bag changes- Returns:
- real bag size
-
getKeySerializer
OBinarySerializer<K> getKeySerializer() -
getValueSerializer
OBinarySerializer<V> getValueSerializer()
-