Class OSBTreeV2<K,V>
java.lang.Object
com.orientechnologies.common.concur.resource.OSharedResourceAbstract
com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
com.orientechnologies.orient.core.storage.index.sbtree.local.v2.OSBTreeV2<K,V>
- All Implemented Interfaces:
OSBTree<K,V>
This is implementation which is based on B+-tree implementation threaded tree. The main
differences are:
- Buckets are not compacted/removed if they are empty after deletion of item. They reused later when new items are added.
- All non-leaf buckets have links to neighbor buckets which contain keys which are less/more
than keys contained in current bucket
- Since:
- 8/7/13
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Field Summary
Fields inherited from class com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
atomicOperationsManager, readCache, storage, writeCacheFields inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
lock -
Constructor Summary
ConstructorsConstructorDescriptionOSBTreeV2(String name, String dataFileExtension, String nullFileExtension, OAbstractPaginatedStorage storage) -
Method Summary
Modifier and TypeMethodDescriptionvoidAcquires exclusive lock in the active atomic operation running on the current thread for this SB-tree.voidclose()voidclose(boolean flush) voidcreate(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, OType[] keyTypes, int keySize, boolean nullPointerSupport, OEncryption encryption) voiddelete(OAtomicOperation atomicOperation) firstKey()voidflush()booleaniterateEntriesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, boolean ascSortOrder) iterateEntriesMajor(K key, boolean inclusive, boolean ascSortOrder) iterateEntriesMinor(K key, boolean inclusive, boolean ascSortOrder) lastKey()voidload(String name, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, OType[] keyTypes, int keySize, boolean nullPointerSupport, OEncryption encryption) voidput(OAtomicOperation atomicOperation, K key, V value) remove(OAtomicOperation atomicOperation, K k) longsize()booleanupdate(OAtomicOperation atomicOperation, K k, OIndexKeyUpdater<V> updater, IndexEngineValidator<K, V> validator) booleanvalidatedPut(OAtomicOperation atomicOperation, K key, V value, IndexEngineValidator<K, V> validator) Methods inherited from class com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
addFile, addPage, calculateInsideComponentOperation, deleteFile, executeInsideComponentOperation, getExtension, getFilledUpTo, getFullName, getLockName, getName, isFileExists, loadOrAddPageForWrite, loadPageForRead, loadPageForWrite, openFile, releasePageFromRead, releasePageFromWrite, setName, truncateFile, tryExecuteInsideComponentOperationMethods inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLock
-
Constructor Details
-
OSBTreeV2
public OSBTreeV2(String name, String dataFileExtension, String nullFileExtension, OAbstractPaginatedStorage storage)
-
-
Method Details
-
create
public void create(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, OType[] keyTypes, int keySize, boolean nullPointerSupport, OEncryption encryption) throws IOException - Specified by:
createin interfaceOSBTree<K,V> - Throws:
IOException
-
isNullPointerSupport
public boolean isNullPointerSupport()- Specified by:
isNullPointerSupportin interfaceOSBTree<K,V>
-
get
-
put
-
validatedPut
public boolean validatedPut(OAtomicOperation atomicOperation, K key, V value, IndexEngineValidator<K, V> validator) - Specified by:
validatedPutin interfaceOSBTree<K,V>
-
update
public boolean update(OAtomicOperation atomicOperation, K k, OIndexKeyUpdater<V> updater, IndexEngineValidator<K, V> validator) -
close
public void close(boolean flush) -
close
public void close() -
delete
- Specified by:
deletein interfaceOSBTree<K,V> - Throws:
IOException
-
load
public void load(String name, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, OType[] keyTypes, int keySize, boolean nullPointerSupport, OEncryption encryption) -
size
public long size() -
remove
-
iterateEntriesMinor
- Specified by:
iterateEntriesMinorin interfaceOSBTree<K,V>
-
iterateEntriesMajor
- Specified by:
iterateEntriesMajorin interfaceOSBTree<K,V>
-
firstKey
-
lastKey
-
keyStream
-
iterateEntriesBetween
public Stream<ORawPair<K,V>> iterateEntriesBetween(K keyFrom, boolean fromInclusive, K keyTo, boolean toInclusive, boolean ascSortOrder) - Specified by:
iterateEntriesBetweenin interfaceOSBTree<K,V>
-
flush
public void flush() -
acquireAtomicExclusiveLock
public void acquireAtomicExclusiveLock()Acquires exclusive lock in the active atomic operation running on the current thread for this SB-tree.- Specified by:
acquireAtomicExclusiveLockin interfaceOSBTree<K,V>
-