
public class OLocalHashTable<K,V> extends ODurableComponent implements OHashTable<K,V>
OHashTableDirectory
class. Directory is not implemented according to classic algorithm because of its big memory consumption in case of non-uniform
data distribution instead it is implemented according too "Multilevel Extendible Hashing Sven Helmer, Thomas Neumann, Guido
Moerkotte April 17, 2002". Which has much less memory consumption in case of nonuniform data distribution. Index itself uses so
called "multilevel schema" when first level contains 256 buckets, when bucket is split it is put at the end of other file which
represents second level. So if data which are put has distribution close to uniform (this index was designed to be use as rid
index for DHT storage) buckets split will be preformed in append only manner to speed up index write speed. So hash index bucket
itself has following structure:
OHashTable.BucketPath, OHashTable.BucketSplitResult, OHashTable.KeyHashCodeComparator<K>, OHashTable.NodeSplitResultatomicOperationsManager, readCache, storage, writeCache| Constructor and Description |
|---|
OLocalHashTable(String name,
String metadataConfigurationFileExtension,
String treeStateFileExtension,
String bucketFileExtension,
String nullBucketFileExtension,
OAbstractPaginatedStorage abstractPaginatedStorage) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireAtomicExclusiveLock()
Acquires exclusive lock in the active atomic operation running on the current thread for this hash table.
|
OHashIndexBucket.Entry<K,V>[] |
ceilingEntries(K key) |
void |
clear(OAtomicOperation atomicOperation) |
void |
close() |
void |
create(OAtomicOperation atomicOperation,
OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer,
OType[] keyTypes,
OEncryption encryption,
OHashFunction<K> keyHashFunction,
boolean nullKeyIsSupported) |
void |
delete(OAtomicOperation atomicOperation) |
void |
deleteWithoutLoad(OAtomicOperation atomicOperation,
String name) |
OHashIndexBucket.Entry<K,V> |
firstEntry() |
OHashIndexBucket.Entry<K,V>[] |
floorEntries(K key) |
void |
flush() |
V |
get(K key) |
OHashIndexBucket.Entry<K,V>[] |
higherEntries(K key) |
OHashIndexBucket.Entry<K,V>[] |
higherEntries(K key,
int limit) |
boolean |
isNullKeyIsSupported() |
OHashIndexBucket.Entry<K,V> |
lastEntry() |
void |
load(String name,
OType[] keyTypes,
boolean nullKeyIsSupported,
OEncryption encryption,
OHashFunction<K> keyHashFunction,
OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer) |
OHashIndexBucket.Entry<K,V>[] |
lowerEntries(K key) |
void |
put(OAtomicOperation atomicOperation,
K key,
V value) |
V |
remove(OAtomicOperation atomicOperation,
K key) |
long |
size() |
boolean |
validatedPut(OAtomicOperation atomicOperation,
K key,
V value,
OBaseIndexEngine.Validator<K,V> validator)
Puts the given value under the given key into this hash table.
|
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, tryAcquireSharedLockclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic void create(OAtomicOperation atomicOperation, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer, OType[] keyTypes, OEncryption encryption, OHashFunction<K> keyHashFunction, boolean nullKeyIsSupported) throws IOException
create in interface OHashTable<K,V>IOExceptionpublic boolean isNullKeyIsSupported()
isNullKeyIsSupported in interface OHashTable<K,V>public void put(OAtomicOperation atomicOperation, K key, V value)
put in interface OHashTable<K,V>public boolean validatedPut(OAtomicOperation atomicOperation, K key, V value, OBaseIndexEngine.Validator<K,V> validator)
OHashTablevalidatedPut in interface OHashTable<K,V>key - the key to put the value under.value - the value to put.validator - the operation validator.true if the validator allowed the put, false otherwise.OBaseIndexEngine.Validator#validate(Object, Object, Object)public V remove(OAtomicOperation atomicOperation, K key)
remove in interface OHashTable<K,V>public void clear(OAtomicOperation atomicOperation)
clear in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V>[] higherEntries(K key)
higherEntries in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V>[] higherEntries(K key, int limit)
higherEntries in interface OHashTable<K,V>public void load(String name, OType[] keyTypes, boolean nullKeyIsSupported, OEncryption encryption, OHashFunction<K> keyHashFunction, OBinarySerializer<K> keySerializer, OBinarySerializer<V> valueSerializer)
load in interface OHashTable<K,V>public void deleteWithoutLoad(OAtomicOperation atomicOperation, String name)
deleteWithoutLoad in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V>[] ceilingEntries(K key)
ceilingEntries in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V> firstEntry()
firstEntry in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V> lastEntry()
lastEntry in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V>[] lowerEntries(K key)
lowerEntries in interface OHashTable<K,V>public OHashIndexBucket.Entry<K,V>[] floorEntries(K key)
floorEntries in interface OHashTable<K,V>public long size()
size in interface OHashTable<K,V>public void close()
close in interface OHashTable<K,V>public void delete(OAtomicOperation atomicOperation) throws IOException
delete in interface OHashTable<K,V>IOExceptionpublic void flush()
flush in interface OHashTable<K,V>public void acquireAtomicExclusiveLock()
OHashTableacquireAtomicExclusiveLock in interface OHashTable<K,V>Copyright © 2009–2025 OrientDB. All rights reserved.