public class OSBTreeBonsaiLocal<K,V> extends ODurableComponent implements OSBTreeBonsai<K,V>
OSBTreeV1
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.OSBTreeV1
OTreeInternal.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 |
create(OAtomicOperation atomicOperation,
OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer,
int pageIndex,
int pageOffset) |
long |
createComponent(OAtomicOperation atomicOperation) |
void |
debugPrintBucket(PrintStream writer) |
void |
delete(OAtomicOperation atomicOperation)
Deletes a whole tree.
|
void |
deleteComponent(OAtomicOperation atomicOperation) |
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,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() |
addFile, addPage, calculateInsideComponentOperation, deleteFile, executeInsideComponentOperation, getExtension, getFilledUpTo, getFullName, getLockName, getName, isFileExists, loadPageForRead, loadPageForRead, loadPageForWrite, openFile, releasePageFromRead, releasePageFromWrite, setName, truncateFile, tryExecuteInsideComponentOperation
acquireExclusiveLock, acquireSharedLock, addUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, releaseExclusiveLock, releaseSharedLock, removeUser, tryAcquireExclusiveLock, tryAcquireSharedLock
public OSBTreeBonsaiLocal(String name, String dataFileExtension, OAbstractPaginatedStorage storage)
public long createComponent(OAtomicOperation atomicOperation)
public void create(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer) throws IOException
IOException
public void create(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, int pageIndex, int pageOffset) throws IOException
IOException
public long getFileId()
OSBTreeBonsai
getFileId
in interface OSBTreeBonsai<K,V>
OReadCache
public OBonsaiBucketPointer getRootBucketPointer()
getRootBucketPointer
in interface OSBTreeBonsai<K,V>
public OBonsaiCollectionPointer getCollectionPointer()
getCollectionPointer
in interface OSBTreeBonsai<K,V>
public V get(K key)
OSBTreeBonsai
get
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)
delete
in interface OSBTreeBonsai<K,V>
public void deleteComponent(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 void flush()
public int getRealBagSize(Map<K,Change> changes)
OSBTreeBonsai
Don't make any changes to tree.
getRealBagSize
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
IOException
public void markToDelete(OAtomicOperation atomicOperation)
markToDelete
in interface OSBTreeBonsai<K,V>
Copyright © 2009–2020 OrientDB. All rights reserved.