Java Doc for AbstractScheduler.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » scheduler » 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.scheduler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.continuent.sequoia.controller.scheduler.AbstractScheduler

All known Subclasses:   org.continuent.sequoia.controller.scheduler.raidb2.RAIDb2PassThroughScheduler,  org.continuent.sequoia.controller.scheduler.singledb.SingleDBPessimisticTransactionLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb2.RAIDb2QueryLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb2.RAIDb2PessimisticTransactionLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb1.RAIDb1PessimisticTransactionLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb0.RAIDb0PassThroughLevelScheduler,  org.continuent.sequoia.controller.scheduler.singledb.SingleDBPassThroughScheduler,  org.continuent.sequoia.controller.scheduler.raidb0.RAIDb0PessimisticTransactionLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb1.RAIDb1QueryLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler,  org.continuent.sequoia.controller.scheduler.raidb1.RAIDb1PassThroughScheduler,  org.continuent.sequoia.controller.scheduler.raidb1.RAIDb1OptimisticQueryLevelScheduler,
AbstractScheduler
abstract public class AbstractScheduler implements XmlComponent(Code)
The Request Scheduler should schedule the request according to a given policy.

The requests comes from the Request Controller and are sent later to the next ccontroller omponents (cache and load balancer).
author:
   Emmanuel Cecchet
author:
   Jean-Bernard van Zuylen
author:
  

author:
   Damian Arregui
version:
   1.0



Field Summary
protected  HashtableactivePersistentConnections
    
protected static  Tracelogger
    
protected  intparsingGranularity
    
protected  intraidbLevel
    

Constructor Summary
public  AbstractScheduler(int raidbLevel, int parsingGranularity, VirtualDatabase vdb, long waitForSuspendedTransactionsTimeout, long waitForPersistentConnectionsTimeout)
     Default scheduler to assign scheduler RAIDb level, needed granularity and SQL macro handling (on the fly instanciation of NOW(), RAND(), ...).
public  AbstractScheduler(int raidbLevel, int parsingGranularity)
     Default scheduler to assign scheduler RAIDb level, needed granularity and SQL macro handling (on the fly instanciation of NOW(), RAND(), ...).

Method Summary
final public  voidbegin(TransactionMetaData tm, boolean isLazyStart, AbstractRequest request)
     Begin a new transaction with the transaction identifier provided in the transaction meta data parameter.
final public  voidbeginCompleted(long transactionId)
     Notify the completion of a begin command.
public  voidclosePersistentConnectionCompleted(long persistentConnectionId)
     Signals the completion of a persistent connection closing operation.
final public  voidcommit(TransactionMetaData tm, boolean emptyTransaction, DistributedCommit dmsg)
     Commit a transaction.
final public  voidcommitCompleted(TransactionMetaData tm, boolean isSuccess)
     Notify the completion of a commit command.
abstract protected  voidcommitTransaction(long transactionId)
     Commit a transaction given its id.
final public  MapgetActiveReadRequests()
     Returns the list of active read requests .
final public  ListgetActiveTransactions()
     Returns the list of active transactions (list contains transaction ids).
final public  MapgetActiveWriteRequests()
     Returns the list of active write requests .
public  longgetNextTransactionId()
    
public  intgetNumberRead()
    
public  intgetNumberWrite()
    
public  HashtablegetOpenPersistentConnections()
     Returns a hashtable of all the open persistent connections (and their associated login).
final public  intgetParsingGranularity()
     Get the needed query parsing granularity.
public  intgetPendingTransactions()
    
final public  intgetPendingWrites()
     Returns the number of pending writes.
public  StringgetPersistentConnectionLogin(Long persistentConnectionId)
     Returns the login associated with a given persistent connection.
final public  intgetRAIDbLevel()
     Returns the RAIDbLevel.
public  String[]getSchedulerData()
    
public  StringgetXml()
    
abstract protected  StringgetXmlImpl()
    
public  booleanhasPersistentConnection(long persistentConnectionId)
    
public synchronized  intincrementSavepointId()
    
final public  voidinitializeTransactionId(long transactionId)
     Initialize the transaction id with the given value (usually retrieved from the recovery log).
public  booleanisActiveRequest(long requestId)
     Returns true if the given request id is in the active request list.
public  booleanisSuspendedRequest(Object obj)
     Checks if an object is in the suspended requests list.
public  booleanisSuspendedWrites()
    
public  voidmergeDatabaseSchema(DatabaseSchema dbs)
     Merge the given DatabaseSchema with the current one.
abstract protected  voidnotifyStoredProcedureCompleted(StoredProcedure proc)
     Notify the completion of a stored procedure.
abstract protected  voidnotifyWriteCompleted(AbstractWriteRequest request)
     Notify the completion of a write statement.
public  voidopenPersistentConnectionCompleted(long persistentConnectionId, boolean success)
     Notify open persistent connection completion.
final public  voidreadCompleted(SelectRequest request)
     Notify the completion of a read statement.
abstract protected  voidreadCompletedNotify(SelectRequest request)
     Notify the completion of a read statement.
final public  voidreleaseSavepoint(TransactionMetaData tm, String name, DistributedReleaseSavepoint dmsg)
     Release a savepoint.
abstract protected  voidreleaseSavepointTransaction(long transactionId, String name)
     Release a savepoint given its name from a transaction given its id.
final public  voidresumeNewPersistentConnections()
     Resume new persistent connections creations that were suspended by suspendNewPersistentConnections().
final public  voidresumeNewTransactions()
     Resume new transactions that were suspended by suspendNewTransactionsForCheckpoint().
public  voidresumeOpenClosePersistentConnection()
     Resumes openinh and closing of persistent connections.
public  voidresumeWrites()
     Resume the execution of the new write queries that were suspended by suspendNewWrites().
public  voidresumeWritesTransactionsAndPersistentConnections()
     Resume suspended writes, transactions and persistent connections (in this order).
final public  voidrollback(TransactionMetaData tm, DistributedRollback dmsg)
     Rollback a transaction.
final public  voidrollback(TransactionMetaData tm, String savepointName, DistributedRollbackToSavepoint dmsg)
     Rollback a transaction to a savepoint.
final public  voidrollbackCompleted(TransactionMetaData tm, boolean isSuccess)
     Notify the completion of a rollback command.
abstract protected  voidrollbackTransaction(long transactionId)
     Rollback a transaction given its id.
abstract protected  voidrollbackTransaction(long transactionId, String savepointName)
     Rollback a transaction given its id to a savepoint given its name.
final public  voidsavepointCompleted(long transactionId)
     Notify the conpletion of a savepoint action.
public  voidscheduleClosePersistentConnection()
     Schedule a close persistent connection.
abstract protected  voidscheduleNonSuspendedReadRequest(SelectRequest request)
    
abstract protected  voidscheduleNonSuspendedStoredProcedure(StoredProcedure proc)
     Schedule a write request (implementation specific).
abstract protected  voidscheduleNonSuspendedWriteRequest(AbstractWriteRequest request)
     Schedule a write request (implementation specific).
public  voidscheduleOpenPersistentConnection(DistributedOpenPersistentConnection dmsg)
     Signals the start of a persistent connection opening operation.
public  voidscheduleReadRequest(SelectRequest request)
    
final public  voidscheduleStoredProcedure(StoredProcedure proc)
     Schedule a write request.
final public  voidscheduleWriteRequest(AbstractWriteRequest request)
     Schedule a write request.
public  voidsetControllerId(long controllerId)
     Assigns the local controllerId.
public  voidsetDatabaseSchema(DatabaseSchema dbs)
     Sets the DatabaseSchema of the current virtual database.
final public  intsetSavepoint(TransactionMetaData tm)
     Set an unnamed savepoint.
final public  voidsetSavepoint(TransactionMetaData tm, String name, DistributedSetSavepoint dmsg)
     Set a named savepoint.
abstract protected  voidsetSavepointTransaction(long transactionId, String name)
     Set a savepoint given its name to a transaction given its id.
final public  voidstoredProcedureCompleted(StoredProcedure proc)
     Notify the completion of a stored procedure.
public  voidsuspendNewPersistentConnections()
     Suspend all new persistent connections creation.
final public  voidsuspendNewTransactions()
     Suspend all calls to begin() until until resumeWrites() is called.
public  voidsuspendNewTransactionsAndWrites()
     Suspend all calls to begin() until until resumeWrites() and resumeNewTransactions are called.
public  voidsuspendNewWrites()
     Suspend all new write queries until resumeWrites() is called. This method does not block and returns immediately.
public  voidsuspendOpenClosePersistentConnection()
     Suspends open and closing of persistent connections.
public  voidwaitForPendingOpenClosePersistentConnection()
     Blocks until all pending open/close persistent connections operations are completed.
public  voidwaitForPersistentConnectionsToComplete()
     Wait for opened persistent connections to complete.
public  voidwaitForRequestCompletion(long requestId)
     Wait for the completion of the given request id.
public  voidwaitForSuspendedTransactionsToComplete()
     Wait for suspended transactions to complete.
public  voidwaitForSuspendedWritesToComplete()
     Wait for suspended writes to complete.
final public  voidwriteCompleted(AbstractWriteRequest request)
     Notify the completion of a write statement.

Field Detail
activePersistentConnections
protected Hashtable activePersistentConnections(Code)
List of persistent connections that have been created
persistentConnectionId (Long) -> vLogin (String)



logger
protected static Trace logger(Code)



parsingGranularity
protected int parsingGranularity(Code)



raidbLevel
protected int raidbLevel(Code)




Constructor Detail
AbstractScheduler
public AbstractScheduler(int raidbLevel, int parsingGranularity, VirtualDatabase vdb, long waitForSuspendedTransactionsTimeout, long waitForPersistentConnectionsTimeout)(Code)
Default scheduler to assign scheduler RAIDb level, needed granularity and SQL macro handling (on the fly instanciation of NOW(), RAND(), ...).
Parameters:
  raidbLevel - RAIDb level of this scheduler
Parameters:
  parsingGranularity - Parsing granularity needed by the scheduler
Parameters:
  vdb - virtual database using this scheduler (needed to access itstotal order queue)



AbstractScheduler
public AbstractScheduler(int raidbLevel, int parsingGranularity)(Code)
Default scheduler to assign scheduler RAIDb level, needed granularity and SQL macro handling (on the fly instanciation of NOW(), RAND(), ...).
Parameters:
  raidbLevel - RAIDb level of this scheduler
Parameters:
  parsingGranularity - Parsing granularity needed by the scheduler




Method Detail
begin
final public void begin(TransactionMetaData tm, boolean isLazyStart, AbstractRequest request) throws SQLException(Code)
Begin a new transaction with the transaction identifier provided in the transaction meta data parameter. Note that this id must retrieve beforehand by calling getNextTransactionId(). This method is called from the driver when setAutoCommit(false) is called.
Parameters:
  tm - The transaction marker metadata
Parameters:
  isLazyStart - true if this begin is triggered by a lazy transactionstart of a transaction initiated by a remote controller. In thatcase, suspended transactions will be ignored (but not suspendedwrites)
Parameters:
  request - request which triggered this operation
throws:
  SQLException - if an error occurs



beginCompleted
final public void beginCompleted(long transactionId)(Code)
Notify the completion of a begin command.
Parameters:
  transactionId - of the completed begin



closePersistentConnectionCompleted
public void closePersistentConnectionCompleted(long persistentConnectionId)(Code)
Signals the completion of a persistent connection closing operation.
Parameters:
  persistentConnectionId - id of the closed persistent connection



commit
final public void commit(TransactionMetaData tm, boolean emptyTransaction, DistributedCommit dmsg) throws SQLException(Code)
Commit a transaction.

Calls the implementation specific commitTransaction()
Parameters:
  tm - The transaction marker metadata
Parameters:
  emptyTransaction - true if we are committing a transaction that didnot execute any query
Parameters:
  dmsg - distributed message which triggered this operation
throws:
  SQLException - if an error occurs
See Also:   AbstractScheduler.commitTransaction(long)




commitCompleted
final public void commitCompleted(TransactionMetaData tm, boolean isSuccess)(Code)
Notify the completion of a commit command.
Parameters:
  tm - The transaction marker metadata
Parameters:
  isSuccess - true if commit was successful, false otherwise



commitTransaction
abstract protected void commitTransaction(long transactionId)(Code)
Commit a transaction given its id.
Parameters:
  transactionId - the transaction id



getActiveReadRequests
final public Map getActiveReadRequests()(Code)
Returns the list of active read requests . Returns the active read requests.



getActiveTransactions
final public List getActiveTransactions()(Code)
Returns the list of active transactions (list contains transaction ids). Returns the active transaction ids.



getActiveWriteRequests
final public Map getActiveWriteRequests()(Code)
Returns the list of active write requests . Write requests can be either StoredProcedure or AbstractWriteRequest objects. Returns the active write requests.



getNextTransactionId
public long getNextTransactionId()(Code)
Retrieve the next transaction identifier next transaction identifier



getNumberRead
public int getNumberRead()(Code)
Returns the numberRead.



getNumberWrite
public int getNumberWrite()(Code)
Returns the numberWrite.



getOpenPersistentConnections
public Hashtable getOpenPersistentConnections()(Code)
Returns a hashtable of all the open persistent connections (and their associated login). persistent connection hashtable



getParsingGranularity
final public int getParsingGranularity()(Code)
Get the needed query parsing granularity. needed query parsing granularity



getPendingTransactions
public int getPendingTransactions()(Code)
Returns the pendingTransactions.



getPendingWrites
final public int getPendingWrites()(Code)
Returns the number of pending writes. int



getPersistentConnectionLogin
public String getPersistentConnectionLogin(Long persistentConnectionId)(Code)
Returns the login associated with a given persistent connection.
Parameters:
  persistentConnectionId - the id of the persistent connection the associated login



getRAIDbLevel
final public int getRAIDbLevel()(Code)
Returns the RAIDbLevel. int



getSchedulerData
public String[] getSchedulerData()(Code)
Returns live information on the scheduler array of data



getXml
public String getXml()(Code)
Get information about the Request Scheduler in xml format String containing information in xml



getXmlImpl
abstract protected String getXmlImpl()(Code)



hasPersistentConnection
public boolean hasPersistentConnection(long persistentConnectionId)(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.hasPersistentConnection(long)



incrementSavepointId
public synchronized int incrementSavepointId()(Code)
Increments the savepoint id for un-named savepoints the next savepoint Id



initializeTransactionId
final public void initializeTransactionId(long transactionId)(Code)
Initialize the transaction id with the given value (usually retrieved from the recovery log).
Parameters:
  transactionId - new current transaction identifier



isActiveRequest
public boolean isActiveRequest(long requestId)(Code)
Returns true if the given request id is in the active request list.
Parameters:
  requestId - the request unique id true if the request is active, false otherwise



isSuspendedRequest
public boolean isSuspendedRequest(Object obj)(Code)
Checks if an object is in the suspended requests list.
Parameters:
  obj - request to be checked true if the request is suspended, false otherwise



isSuspendedWrites
public boolean isSuspendedWrites()(Code)
Returns the suspendedWrites.



mergeDatabaseSchema
public void mergeDatabaseSchema(DatabaseSchema dbs)(Code)
Merge the given DatabaseSchema with the current one.
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.scheduler.schema.SchedulerDatabaseSchema



notifyStoredProcedureCompleted
abstract protected void notifyStoredProcedureCompleted(StoredProcedure proc)(Code)
Notify the completion of a stored procedure. This method does not need to be synchronized, it is enforced by the caller.
Parameters:
  proc - the completed stored procedure
See Also:   AbstractScheduler.storedProcedureCompleted(StoredProcedure)



notifyWriteCompleted
abstract protected void notifyWriteCompleted(AbstractWriteRequest request)(Code)
Notify the completion of a write statement. This method does not need to be synchronized, it is enforced by the caller.
Parameters:
  request - the completed request
See Also:   AbstractScheduler.writeCompleted(AbstractWriteRequest)



openPersistentConnectionCompleted
public void openPersistentConnectionCompleted(long persistentConnectionId, boolean success)(Code)
Notify open persistent connection completion. If it failed the connection is removed from the persistentConnections table.
Parameters:
  persistentConnectionId - id of the opened persistent connection
Parameters:
  success - true if connection opening was successful in which case theconnection is added to the persistent connection list



readCompleted
final public void readCompleted(SelectRequest request) throws SQLException(Code)
Notify the completion of a read statement.
Parameters:
  request - the completed request
throws:
  SQLException - if the query was not in the list of active readrequests (not scheduled)



readCompletedNotify
abstract protected void readCompletedNotify(SelectRequest request)(Code)
Notify the completion of a read statement.
Parameters:
  request - the completed request



releaseSavepoint
final public void releaseSavepoint(TransactionMetaData tm, String name, DistributedReleaseSavepoint dmsg) throws SQLException(Code)
Release a savepoint.

Calls the implementation specific releaseSavepointTransaction()
Parameters:
  tm - transaction marker metadata
Parameters:
  name - name of the savepoint
Parameters:
  dmsg - distributed message which triggered this operation
throws:
  SQLException - if an error occurs




releaseSavepointTransaction
abstract protected void releaseSavepointTransaction(long transactionId, String name)(Code)
Release a savepoint given its name from a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  name - the name of the savepoint



resumeNewPersistentConnections
final public void resumeNewPersistentConnections()(Code)
Resume new persistent connections creations that were suspended by suspendNewPersistentConnections().
See Also:   AbstractScheduler.suspendNewPersistentConnections()



resumeNewTransactions
final public void resumeNewTransactions()(Code)
Resume new transactions that were suspended by suspendNewTransactionsForCheckpoint().
See Also:   AbstractScheduler.suspendNewTransactions()



resumeOpenClosePersistentConnection
public void resumeOpenClosePersistentConnection()(Code)
Resumes openinh and closing of persistent connections.



resumeWrites
public void resumeWrites()(Code)
Resume the execution of the new write queries that were suspended by suspendNewWrites().
See Also:   AbstractScheduler.suspendNewWrites()



resumeWritesTransactionsAndPersistentConnections
public void resumeWritesTransactionsAndPersistentConnections()(Code)
Resume suspended writes, transactions and persistent connections (in this order).



rollback
final public void rollback(TransactionMetaData tm, DistributedRollback dmsg) throws SQLException(Code)
Rollback a transaction.

Calls the implementation specific rollbackTransaction()
Parameters:
  tm - The transaction marker metadata
Parameters:
  dmsg - distributed message which triggered this operation
exception:
  SQLException - if an error occurs
See Also:   AbstractScheduler.rollbackTransaction(long)




rollback
final public void rollback(TransactionMetaData tm, String savepointName, DistributedRollbackToSavepoint dmsg) throws SQLException(Code)
Rollback a transaction to a savepoint.

Calls the implementation specific rollbackTransaction()
Parameters:
  tm - transaction marker metadata
Parameters:
  savepointName - name of the savepoint
Parameters:
  dmsg - distributed message which triggered this operation
throws:
  SQLException - if an error occurs




rollbackCompleted
final public void rollbackCompleted(TransactionMetaData tm, boolean isSuccess)(Code)
Notify the completion of a rollback command.
Parameters:
  tm - The transaction marker metadata
Parameters:
  isSuccess - true if commit was successful, false otherwise



rollbackTransaction
abstract protected void rollbackTransaction(long transactionId)(Code)
Rollback a transaction given its id.
Parameters:
  transactionId - the transaction id



rollbackTransaction
abstract protected void rollbackTransaction(long transactionId, String savepointName)(Code)
Rollback a transaction given its id to a savepoint given its name.
Parameters:
  transactionId - the transaction id
Parameters:
  savepointName - the name of the savepoint



savepointCompleted
final public void savepointCompleted(long transactionId)(Code)
Notify the conpletion of a savepoint action.
Parameters:
  transactionId - the transaction identifier



scheduleClosePersistentConnection
public void scheduleClosePersistentConnection()(Code)
Schedule a close persistent connection.



scheduleNonSuspendedReadRequest
abstract protected void scheduleNonSuspendedReadRequest(SelectRequest request) throws SQLException(Code)
Schedule a read request (implementation specific)
Parameters:
  request - Select request to schedule (SQL macros are already handledif needed)
exception:
  SQLException - if a timeout occurs



scheduleNonSuspendedStoredProcedure
abstract protected void scheduleNonSuspendedStoredProcedure(StoredProcedure proc) throws SQLException, RollbackException(Code)
Schedule a write request (implementation specific). This method blocks until the request can be executed.
Parameters:
  proc - Stored procedure to schedule
exception:
  SQLException - if a timeout occurs
exception:
  RollbackException - if the transaction must be rollbacked



scheduleNonSuspendedWriteRequest
abstract protected void scheduleNonSuspendedWriteRequest(AbstractWriteRequest request) throws SQLException, RollbackException(Code)
Schedule a write request (implementation specific). This method blocks until the request can be executed.
Parameters:
  request - Write request to schedule (SQL macros are already handled ifneeded)
exception:
  SQLException - if a timeout occurs
exception:
  RollbackException - if the transaction must be rollbacked



scheduleOpenPersistentConnection
public void scheduleOpenPersistentConnection(DistributedOpenPersistentConnection dmsg)(Code)
Signals the start of a persistent connection opening operation.
Parameters:
  dmsg - distributed message which triggered this operation



scheduleReadRequest
public void scheduleReadRequest(SelectRequest request) throws SQLException(Code)
Schedule a read request
Parameters:
  request - select request to schedule
exception:
  SQLException - if a timeout occurs or a query with the same id hasalready been scheduled.



scheduleStoredProcedure
final public void scheduleStoredProcedure(StoredProcedure proc) throws SQLException, RollbackException(Code)
Schedule a write request. This method blocks if the writes are suspended. Then the number of pending writes is updated and the implementation specific scheduleNonSuspendedWriteRequest function is called. SQL macros are replaced in the request if the scheduler has needSQLMacroHandling set to true.
Parameters:
  proc - Stored procedure to schedule
exception:
  SQLException - if a timeout occurs
exception:
  RollbackException - if an error occurs
See Also:   AbstractScheduler.scheduleNonSuspendedStoredProcedure(StoredProcedure)



scheduleWriteRequest
final public void scheduleWriteRequest(AbstractWriteRequest request) throws SQLException, RollbackException(Code)
Schedule a write request. This method blocks if the writes are suspended. Then the number of pending writes is updated and the implementation specific scheduleNonSuspendedWriteRequest function is called. SQL macros are replaced in the request if the scheduler has needSQLMacroHandling set to true.
Parameters:
  request - Write request to schedule
exception:
  SQLException - if a timeout occurs or a query with the same id hasalready been scheduled.
exception:
  RollbackException - if an error occurs
See Also:   AbstractScheduler.scheduleNonSuspendedWriteRequest(AbstractWriteRequest)



setControllerId
public void setControllerId(long controllerId)(Code)
Assigns the local controllerId. It is used for generating transactionIds for autocommit requests.
Parameters:
  controllerId - for this controller



setDatabaseSchema
public void setDatabaseSchema(DatabaseSchema dbs)(Code)
Sets the DatabaseSchema of the current virtual database. This is only needed by some schedulers that will have to define their own scheduler schema
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.scheduler.schema.SchedulerDatabaseSchema



setSavepoint
final public int setSavepoint(TransactionMetaData tm) throws SQLException(Code)
Set an unnamed savepoint.

Calls the implementation specific setSavepointTransaction()
Parameters:
  tm - transaction marker metadata savepoint Id
throws:
  SQLException - if an error occurs




setSavepoint
final public void setSavepoint(TransactionMetaData tm, String name, DistributedSetSavepoint dmsg) throws SQLException(Code)
Set a named savepoint.

Calls the implementation specific setSavepointTransaction()
Parameters:
  tm - transaction marker metadata
Parameters:
  name - name of the savepoint
Parameters:
  dmsg - distributed message which triggered this operation
throws:
  SQLException - if an error occurs




setSavepointTransaction
abstract protected void setSavepointTransaction(long transactionId, String name)(Code)
Set a savepoint given its name to a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  name - the name of the savepoint



storedProcedureCompleted
final public void storedProcedureCompleted(StoredProcedure proc) throws SQLException(Code)
Notify the completion of a stored procedure.

This method updates the number of pending writes and calls the implementation specific notifyStoredProcedureCompleted function.

Finally, the suspendWrites() function is notified if needed.
Parameters:
  proc - the completed stored procedure
throws:
  SQLException - if the stored procedure was not scheduled before (notin the active request list)
See Also:   AbstractScheduler.notifyStoredProcedureCompleted(StoredProcedure)
See Also:   AbstractScheduler.checkPendingWrites()




suspendNewPersistentConnections
public void suspendNewPersistentConnections()(Code)
Suspend all new persistent connections creation. This method does not block and returns immediately. New connections remain suspended until resumeNewPersistentConnections() is called.
See Also:   AbstractScheduler.resumeNewPersistentConnections()
See Also:   AbstractScheduler.waitForSuspendedPersistentConnectionsToComplete()



suspendNewTransactions
final public void suspendNewTransactions()(Code)
Suspend all calls to begin() until until resumeWrites() is called. This method does not block and returns immediately. To synchronize on suspended writes completion, you must call waitForSuspendedWritesToComplete().

New transactions remain suspended until resumeNewTransactions() is called.
See Also:   AbstractScheduler.resumeNewTransactions()
See Also:   AbstractScheduler.waitForSuspendedTransactionsToComplete()




suspendNewTransactionsAndWrites
public void suspendNewTransactionsAndWrites()(Code)
Suspend all calls to begin() until until resumeWrites() and resumeNewTransactions are called. This method does not block and returns immediately. To synchronize on suspended writes completion, you must call waitForSuspendedWritesToComplete(). Suspending writes and transactions is done atomically in order to close a window in begin().

New transactions remain suspended until resumeNewTransactions() and resumeWrites are called.
See Also:   AbstractScheduler.resumeNewTransactions()
See Also:   AbstractScheduler.waitForSuspendedTransactionsToComplete()




suspendNewWrites
public void suspendNewWrites()(Code)
Suspend all new write queries until resumeWrites() is called. This method does not block and returns immediately. To synchronize on suspended writes completion, you must call waitForSuspendedWritesToComplete().
See Also:   AbstractScheduler.resumeWrites()
See Also:   AbstractScheduler.waitForSuspendedWritesToComplete()



suspendOpenClosePersistentConnection
public void suspendOpenClosePersistentConnection()(Code)
Suspends open and closing of persistent connections.
See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.closePersistentConnection(Stringlong)



waitForPendingOpenClosePersistentConnection
public void waitForPendingOpenClosePersistentConnection()(Code)
Blocks until all pending open/close persistent connections operations are completed.



waitForPersistentConnectionsToComplete
public void waitForPersistentConnectionsToComplete() throws SQLException(Code)
Wait for opened persistent connections to complete. Returns as soon as number of pending persistent connections has reached 0.
throws:
  SQLException - if an error occured during wait



waitForRequestCompletion
public void waitForRequestCompletion(long requestId)(Code)
Wait for the completion of the given request id. The method returns as soon as the request completion has been notified to the scheduler.
Parameters:
  requestId - the unique request identifier



waitForSuspendedTransactionsToComplete
public void waitForSuspendedTransactionsToComplete() throws SQLException(Code)
Wait for suspended transactions to complete. Returns as soon as number of pending transactions has reached 0.
throws:
  SQLException - if an error occured during wait



waitForSuspendedWritesToComplete
public void waitForSuspendedWritesToComplete() throws SQLException(Code)
Wait for suspended writes to complete. Returns as soon as number of pending writes has reached 0.
throws:
  SQLException - if an error occured during wait



writeCompleted
final public void writeCompleted(AbstractWriteRequest request) throws SQLException(Code)
Notify the completion of a write statement.

This method updates the number of pending writes and calls the implementation specific notifyWriteCompleted function.

Finally, the suspendWrites() function is notified if needed.
Parameters:
  request - the completed request
throws:
  SQLException - if the query is not in the list of scheduled queries
See Also:   AbstractScheduler.notifyWriteCompleted(AbstractWriteRequest)
See Also:   AbstractScheduler.checkPendingWrites()




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.