public final class LockTableUpdater extends java.lang.Object implements LockListener
lock listener implementation
which
receives record lock events and updates the metadata lock table accordingly. This involves the
creation, lookup, and deletion of metadata lock records. To avoid impacting the performance of
the current session's database operations, most of this work is done within a separate,
dedicated, server thread.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 metaDatabase)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
flushQueue()
This method is called within a user context to force any pending lock events to be
processed.
|
void |
lockChanged(RecordLockEvent event)
Method which is called by a
LockManager in response to a lock event. |
void |
terminate()
Stop processing record lock events for the associated, primary database.
|
private static final java.util.logging.Logger log
private final LockTableUpdater.UpdateWorker worker
private final ContextLocal<integer> sessionID
public LockTableUpdater(Database metaDatabase)
metaDatabase
- Metadata database.public void flushQueue()
public void terminate()
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.