class TxnMonitor extends Object implements Runnable
TxnMonitorTask
,
OutriggerServerImpl.monitor(org.apache.river.outrigger.QueryWatcher, java.util.Collection<org.apache.river.outrigger.Txn>)
Modifier and Type | Class and Description |
---|---|
private static class |
TxnMonitor.ToMonitor
Each
ToMonitor object represents a need to monitor
the given transactions, possibly under a lease. |
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
Logger for logging transaction related information
|
private Thread |
ourThread
The thread running us.
|
private LinkedList<TxnMonitor.ToMonitor> |
pending
This list is used to contain requests to monitor interfering
transactions.
|
private OutriggerServerImpl |
space
The space we belong to.
|
private boolean |
started |
private java.util.concurrent.ExecutorService |
taskManager
The manager for
TxnMonitorTask objects. |
private WakeupManager |
wakeupMgr
wakeup manager for
TxnMonitorTask s |
Constructor and Description |
---|
TxnMonitor(OutriggerServerImpl space,
Configuration config)
Create a new TxnMonitor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(Collection<Txn> transactions)
Add a set of
transactions to be monitored under no
lease. |
(package private) void |
add(QueryWatcher query,
Collection<Txn> transactions)
Add a set of
transactions to be monitored under the
given query. |
void |
destroy() |
void |
run()
Take pending monitor requests off the queue, creating the
required
TxnMonitorTask objects and scheduling them. |
(package private) OutriggerServerImpl |
space()
Return the space we're part of.
|
void |
start() |
private TxnMonitorTask |
taskFor(Txn txn)
Return the monitor task for this transaction, creating it if
necessary.
|
private final LinkedList<TxnMonitor.ToMonitor> pending
getMatch
request that detected the conflict
doesn't have to wait for all the setup before returning -- it
just puts the data on this list and the TxnMonitor
pulls it off using its own thread.private final WakeupManager wakeupMgr
TxnMonitorTask
sprivate final java.util.concurrent.ExecutorService taskManager
TxnMonitorTask
objects.private final OutriggerServerImpl space
private final Thread ourThread
private volatile boolean started
private static final Logger logger
TxnMonitor(OutriggerServerImpl space, Configuration config) throws ConfigurationException
ConfigurationException
public void start()
public void destroy()
OutriggerServerImpl space()
void add(QueryWatcher query, Collection<Txn> transactions)
transactions
to be monitored under the
given query.void add(Collection<Txn> transactions)
transactions
to be monitored under no
lease.public void run()
TxnMonitorTask
objects and scheduling them.private TxnMonitorTask taskFor(Txn txn)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.