Java Doc for BackendTaskQueues.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » loadbalancer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.loadbalancer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.continuent.sequoia.controller.loadbalancer.BackendTaskQueues

BackendTaskQueues
public class BackendTaskQueues (Code)
This class defines task queues that stores the requests to be executed on a database backend.
author:
   Emmanuel Cecchet
version:
   1.0



Constructor Summary
public  BackendTaskQueues(DatabaseBackend backend, WaitForCompletionPolicy waitForCompletionPolicy, RequestManager requestManager)
    

Method Summary
public  booleanabortAllQueriesForTransaction(long tid)
     Abort all queries belonging to the provided transaction.
public  voidabortRemainingRequests()
     Abort all requests remaining in the queues.
final public  voidaddTaskToBackendTotalOrderQueue(AbstractTask task)
    
final public  voidaddTaskToBackendTotalOrderQueue(AbstractTask task, int queueSize)
     Add a task at the end of the backend total order queue.
public  booleanallowTasksToBePosted()
     Return true if tasks are allowed to be posted to the queue.
final public  voidcheckForPriorityInversion()
     Check for priority inversion in the conflicting queue or possibly stored procedure queue flushing if a transaction executing a stored procedure has just completed.
public  voidcompleteStoredProcedureExecution(AbstractTask task)
    
public  voidcompleteWriteRequestExecution(AbstractTask task)
    
final public  voidcompletedEntryExecution(BackendTaskQueueEntry entry)
     Notify the completion of the given entry.
protected synchronized  Stringdump()
     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.
final public  BackendTaskQueueEntrygetFirstConflictingRequestQueueOrStoredProcedureQueueEntry()
     Return the first entry in the conflicting requests queue (does not remove it from the list).
public  BackendTaskQueueEntrygetNextCommitRollbackToExecute(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.
final public  BackendTaskQueueEntrygetNextEntryToExecute(BackendWorkerThread thread)
     Get the next available task entry to process from the queues.
public  ListgetStoredProcedureQueue()
     Returns the stored procedure queue.
public  voidreleaseLocksAndCheckForPriorityInversion(TransactionMetaData tm)
     Releasing locks and checking for priority inversion.
public  voidsetAllowTasksToBePosted(boolean allowTasksToBePosted)
    
public  voidstartDeadlockDetectionThread(VirtualDatabase vdb)
     Start a new Deadlock Detection Thread (throws a RuntimeException if called twice without stopping the thread before the second call).
public  voidterminateDeadlockDetectionThread()
     Terminate the Deadlock Detection Thread.


Constructor Detail
BackendTaskQueues
public BackendTaskQueues(DatabaseBackend backend, WaitForCompletionPolicy waitForCompletionPolicy, RequestManager requestManager)(Code)
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



abortRemainingRequests
public void abortRemainingRequests()(Code)
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



allowTasksToBePosted
public boolean allowTasksToBePosted()(Code)
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



completeStoredProcedureExecution
public void completeStoredProcedureExecution(AbstractTask task)(Code)
Perform the cleanup to release locks and priority inversion checkings after a stored procedure execution
Parameters:
  task - the task that completed



completeWriteRequestExecution
public void completeWriteRequestExecution(AbstractTask task)(Code)
Perform the cleanup to release locks and priority inversion checkings after a write query execution
Parameters:
  task - the task that completed



completedEntryExecution
final public void completedEntryExecution(BackendTaskQueueEntry entry)(Code)
Notify the completion of the given entry. The corresponding task completion is notified to the backend.
Parameters:
  entry - the executed entry



dump
protected synchronized String dump()(Code)
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



getFirstConflictingRequestQueueOrStoredProcedureQueueEntry
final public BackendTaskQueueEntry getFirstConflictingRequestQueueOrStoredProcedureQueueEntry()(Code)
Return the first entry in the conflicting requests queue (does not remove it from the list). the first entry in the conflicting queue



getNextCommitRollbackToExecute
public BackendTaskQueueEntry getNextCommitRollbackToExecute(BackendWorkerThread thread)(Code)
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



getNextEntryToExecute
final public BackendTaskQueueEntry getNextEntryToExecute(BackendWorkerThread thread)(Code)
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



getStoredProcedureQueue
public List getStoredProcedureQueue()(Code)
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.



releaseLocksAndCheckForPriorityInversion
public void releaseLocksAndCheckForPriorityInversion(TransactionMetaData tm)(Code)
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.



startDeadlockDetectionThread
public void startDeadlockDetectionThread(VirtualDatabase vdb)(Code)
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).



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.