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 CentralLogger |
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,
DatabaseConfig cfg)
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 CentralLogger log
private final LockTableUpdater.UpdateWorker worker
private final ContextLocal<integer> sessionID
public LockTableUpdater(Database primary, Database metaDatabase, DatabaseConfig cfg)
primary - Primary databasemetaDatabase - Metadata database.cfg - The database configuration.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 LockListenerevent - Object which describes the lock event.