public final class LockTableUpdater extends java.lang.Object implements LockListener
lock listener
implementation which
receives record lock events and updates the metadata lock in-memory map accordingly.
When application executes query against the _Lock table the information about active locks is
persisted into the meta database before executing the query.
Persisted locks are deleted from the meta table in a separate thread when they are released.Modifier and Type | Class and Description |
---|---|
static interface |
LockTableUpdater.MinimalLock
Interface which defines the minimally required methods of the
MetaLock
interface. |
private static class |
LockTableUpdater.UpdateWorker
A worker containing a queue to which record lock events are written from multiple user
threads/contexts, and from which those events are read in a dedicated, daemon thread.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
log
Logger
|
private ContextLocal<integer> |
sessionID
Numeric ID of the user in the current session
|
private LockTableUpdater.UpdateWorker |
worker
Worker which processes record lock events in a dedicated server thread
|
Constructor and Description |
---|
LockTableUpdater(Database primary,
Database metaDatabase)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
lockChanged(RecordLockEvent event)
Method which is called by a
LockManager in response to a lock event. |
void |
persist()
Persist locks in the meta database
|
private static final java.util.logging.Logger log
private final LockTableUpdater.UpdateWorker worker
private final ContextLocal<integer> sessionID
public void persist()
public void lockChanged(RecordLockEvent event)
LockManager
in response to a lock event. Does some
preliminary processing and sanity checking, then queues the event for further processing on
a dedicated thread.lockChanged
in interface LockListener
event
- Object which describes the lock event.