public class ReadWriteLockManager extends Object implements IReadWriteLockManager
ICommitters.| Modifier and Type | Method and Description |
|---|---|
static ReadWriteLockManager |
getLockManager(ICheckpointProtocol index)
Canonicalizing factory for the
ReadWriteLock for an
ICommitter. |
int |
getReadLockCount()
Return the #of read-locks held by the current thread for a mutable index
view.
|
boolean |
isReadOnly()
Return
true iff the data structure is read-only. |
Lock |
readLock()
Return a
Lock that may be used to obtain a shared read lock which
is used (in the absence of other concurrency control mechanisms) to
permit concurrent readers on an unisolated index while serializing access
to that index when a writer must run. |
Lock |
writeLock()
Return a
Lock that may be used to obtain an exclusive write lock
which is used (in the absence of other concurrency control mechanisms) to
serialize all processes accessing an unisolated index when a writer must
run. |
public int getReadLockCount()
IReadWriteLockManagergetReadLockCount in interface IReadWriteLockManagerpublic Lock readLock()
IReadWriteLockManagerLock that may be used to obtain a shared read lock which
is used (in the absence of other concurrency control mechanisms) to
permit concurrent readers on an unisolated index while serializing access
to that index when a writer must run. This is exposed for processes which
need to obtain the write lock to coordinate external operations.
Note: If the persistence capable data structure is read-only then the
returned Lock is a singleton that ignores all lock requests. This
is because our read-only persistence capable data structures are already
thread-safe for concurrent readers.
readLock in interface IReadWriteLockManagerpublic Lock writeLock()
IReadWriteLockManagerLock that may be used to obtain an exclusive write lock
which is used (in the absence of other concurrency control mechanisms) to
serialize all processes accessing an unisolated index when a writer must
run. This is exposed for processes which need to obtain the write lock to
coordinate external operations.writeLock in interface IReadWriteLockManagerpublic boolean isReadOnly()
IReadWriteLockManagertrue iff the data structure is read-only.isReadOnly in interface IReadWriteLockManagerpublic static ReadWriteLockManager getLockManager(ICheckpointProtocol index)
ReadWriteLock for an
ICommitter.
Note: This method CAN NOT be exposed since that breaks encapsulation for
the WrappedReadLock.
index - The btree.IllegalArgumentException - if the argument is null.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.