public class OLocalHashTableV3<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.Entry<K,V>, OHashTable.KeyHashCodeComparator<K>, OHashTable.NodeSplitResult, OHashTable.RawEntry
atomicOperationsManager, readCache, storage, writeCache
Constructor and Description |
---|
OLocalHashTableV3(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.
|
OHashTable.Entry<K,V>[] |
ceilingEntries(K key) |
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) |
OHashTable.Entry<K,V> |
firstEntry() |
OHashTable.Entry<K,V>[] |
floorEntries(K key) |
void |
flush() |
V |
get(K key) |
OHashTable.Entry<K,V>[] |
higherEntries(K key) |
OHashTable.Entry<K,V>[] |
higherEntries(K key,
int limit) |
boolean |
isNullKeyIsSupported() |
OHashTable.Entry<K,V> |
lastEntry() |
void |
load(String name,
OType[] keyTypes,
boolean nullKeyIsSupported,
OEncryption encryption,
OHashFunction<K> keyHashFunction,
OBinarySerializer<K> keySerializer,
OBinarySerializer<V> valueSerializer) |
OHashTable.Entry<K,V>[] |
lowerEntries(K key) |
void |
put(OAtomicOperation atomicOperation,
K key,
V value) |
V |
remove(OAtomicOperation atomicOperation,
K k) |
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, releasePageFromRead, releasePageFromWrite, setName, truncateFile, tryExecuteInsideComponentOperation
acquireExclusiveLock, acquireSharedLock, addUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, releaseExclusiveLock, releaseSharedLock, removeUser, tryAcquireExclusiveLock, tryAcquireSharedLock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public 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>
IOException
public 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)
OHashTable
validatedPut
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 k)
remove
in interface OHashTable<K,V>
public OHashTable.Entry<K,V>[] higherEntries(K key)
higherEntries
in interface OHashTable<K,V>
public OHashTable.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 OHashTable.Entry<K,V>[] ceilingEntries(K key)
ceilingEntries
in interface OHashTable<K,V>
public OHashTable.Entry<K,V> firstEntry()
firstEntry
in interface OHashTable<K,V>
public OHashTable.Entry<K,V> lastEntry()
lastEntry
in interface OHashTable<K,V>
public OHashTable.Entry<K,V>[] lowerEntries(K key)
lowerEntries
in interface OHashTable<K,V>
public OHashTable.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>
IOException
public void flush()
flush
in interface OHashTable<K,V>
public void acquireAtomicExclusiveLock()
OHashTable
acquireAtomicExclusiveLock
in interface OHashTable<K,V>
Copyright © 2009–2020 OrientDB. All rights reserved.