allowTasksToBePosted() Return true if tasks are allowed to be posted to the queue.
final public void
checkForPriorityInversion() Check for priority inversion in the conflicting queue or possibly stored
procedure queue flushing if a transaction executing a stored procedure has
just completed.
dump() Returns a String corresponding to the dump of the internal
state of this BackendTaskQueues.
This method is synchronized to provided a consistent snapshots of the
queues.
getNextCommitRollbackToExecute(BackendWorkerThread thread) Get the next available commit or rollback task to process from the queues.
If the backend is killed, this method will return a KillThreadTask else it
will wait for a task to be ready to be executed.
startDeadlockDetectionThread(VirtualDatabase vdb) Start a new Deadlock Detection Thread (throws a RuntimeException if called
twice without stopping the thread before the second call).
Creates a new BackendTaskQueues object
Parameters: backend - DatabaseBackend associated to these queues Parameters: waitForCompletionPolicy - the load balancer wait for completion policy Parameters: requestManager - the request manager associated with these queues
Method Detail
abortAllQueriesForTransaction
public boolean abortAllQueriesForTransaction(long tid)(Code)
Abort all queries belonging to the provided transaction.
Parameters: tid - the transaction identifier true if a rollback is already in progress
Abort all requests remaining in the queues. This is usually called when the
backend is disabled and no backend worker thread should be processing any
request any more (this will generate a warning otherwise).
addTaskToBackendTotalOrderQueue
final public void addTaskToBackendTotalOrderQueue(AbstractTask task)(Code)
Add a task at the end of the backend total order queue
Parameters: task - the task to add
addTaskToBackendTotalOrderQueue
final public void addTaskToBackendTotalOrderQueue(AbstractTask task, int queueSize)(Code)
Add a task at the end of the backend total order queue. Block as long as
the total order queue size if over the indicated queue size.
Parameters: task - the task to add Parameters: queueSize - the maximum queue size
Return true if tasks are allowed to be posted to the queue. If false, all
tasks posted to the queue are systematically notified for completion
without being executed (abort behavior)
Returns the allowTasksToBePosted.
checkForPriorityInversion
final public void checkForPriorityInversion()(Code)
Check for priority inversion in the conflicting queue or possibly stored
procedure queue flushing if a transaction executing a stored procedure has
just completed. remove this entry and possibly re-arrange the queues
Returns a String corresponding to the dump of the internal
state of this BackendTaskQueues.
This method is synchronized to provided a consistent snapshots of the
queues.
a String representing the internal state of thisBackendTaskQueues
Get the next available commit or rollback task to process from the queues.
If the backend is killed, this method will return a KillThreadTask else it
will wait for a task to be ready to be executed. Note that the task is left
in the queue and flagged as processed by the thread given as a parameter.
The task will only be removed from the queue when the thread notifies the
completion of the task.
Parameters: thread - the thread that will execute the task the commmit or rollback task to execute
Get the next available task entry to process from the queues. If the
backend is killed, this method will return a KillThreadTask else it will
wait for a task to be ready to be executed. Note that the task is left in
the queue and flagged as processed by the thread given as a parameter. The
task will only be removed from the queue when the thread notifies the
completion of the task.
Parameters: thread - the thread that will execute the task the task to execute
Returns the stored procedure queue. This is needed for deadlock detection
but clearly does break the abstarction layer as it exposes a private field
in an un-controlled way.
the stored procedure queue.
Releasing locks and checking for priority inversion. Usually used at commit
or rollback completion time.
Parameters: tm - the transaction metadata
setAllowTasksToBePosted
public void setAllowTasksToBePosted(boolean allowTasksToBePosted)(Code)
Set to true if tasks are allowed to be posted to the queue else, all tasks
posted to the queue are systematically notified for completion without
being executed (abort behavior)
Parameters: allowTasksToBePosted - The allowTasksToBePosted to set.
Start a new Deadlock Detection Thread (throws a RuntimeException if called
twice without stopping the thread before the second call).
Parameters: vdb - the virtual database the backend is attached to
terminateDeadlockDetectionThread
public void terminateDeadlockDetectionThread()(Code)
Terminate the Deadlock Detection Thread. Throws a RuntimeException is the
thread was already stopped (or not started).