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


org.continuent.sequoia.controller.requestmanager.RequestManager
   org.continuent.sequoia.controller.requestmanager.distributed.DistributedRequestManager

All known Subclasses:   org.continuent.sequoia.controller.requestmanager.distributed.RAIDb2DistributedRequestManager,  org.continuent.sequoia.controller.requestmanager.distributed.RAIDb1DistributedRequestManager,
DistributedRequestManager
abstract public class DistributedRequestManager extends RequestManager (Code)
This class defines a Distributed Request Manager.

The DRM is composed of a Request Scheduler, an optional Query Cache, and a Load Balancer and an optional Recovery Log. Unlike a non-distributed Request Manager, this implementation is responsible for synchronizing the different controllers components (schedulers, ...). Functions that are RAIDb level dependent are implemented in sub-classes.
author:
   Emmanuel Cecchet
author:
   Jean-Bernard van Zuylen
author:
  

author:
   Damian Arregui
version:
   1.0



Field Summary
final public static  longCONTROLLER_ID_BITS
    
final public static  longCONTROLLER_ID_BIT_MASK
     Effective controllerIds are on the upper 16 bits of a long (64 bits). Distributed transaction ids (longs) are layed out as [ControllerId(16bits) | LocalTransactionId(64bits)].
final public static  intCONTROLLER_ID_SHIFT_BITS
    
final public static  IntegerSUCCESSFUL_COMPLETION
    
final public static  longTRANSACTION_ID_BIT_MASK
    
protected  LinkedListdistributedTransactions
    
protected  DistributedVirtualDatabasedvdb
    

Constructor Summary
public  DistributedRequestManager(DistributedVirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, RecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout)
     Builds a new DistributedRequestManager instance without cache.

Method Summary
public  voidabort(long transactionId, boolean logAbort, boolean forceAbort)
    
public  voidaddFailedOnAllBackends(AbstractRequest request, boolean needSchedulerNotification)
     Add a request that failed on all backends.
public  longbegin(String login, boolean isPersistentConnection, long persistentConnectionId)
    
public  voidblockActivity()
     Suspend all transactions, writes and persistent connections and do not wait for completion of in-flight transactions and/or persistent connections.

This method blocks activity in the cluster and should not be called in normal cluster situation.

public  ExecuteResultcallableStatementExecute(StoredProcedure proc)
    
public  ControllerResultSetcallableStatementExecuteQuery(StoredProcedure proc)
    
public  ExecuteUpdateResultcallableStatementExecuteUpdate(StoredProcedure proc)
    
public  voidcleanupAllFailedQueriesFromController(long failedControllerId)
     Cleanup all queries registered as failed issued from the given controller. This is used when a controller has failed and no status information will be returned for failed queries.
public  voidcleanupRollbackFromOtherController(long tId)
     Cleanup all queries from a given transaction that were registered as failed and issued from the other controller.
public  voidclosePersistentConnection(Long connectionId)
     Retrieve the vLogin corresponding to the persistent connection id provided and close the connection if found.
public  voidcommit(long transactionId, boolean logCommit, boolean emptyTransaction)
    
public  voidcompleteFailedOnAllBackends(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, int updateCount)
     Notify completion of a request that either failed on all backends or was not executed at all (NoMoreBackendException).
public  voidcompleteTransaction(Long tid)
    
public  voiddisableBackend(DatabaseBackend db, boolean forceDisable)
    
public  voiddisableBackendsWithCheckpoint(ArrayList backendInfos, String checkpointName)
    
abstract public  voiddistributedAbort(String login, long transactionId)
    
abstract public  ExecuteResultdistributedCallableStatementExecute(StoredProcedure proc)
     Distributed implementation of a stored procedure CallableStatement.execute() execution.
abstract public  ControllerResultSetdistributedCallableStatementExecuteQuery(StoredProcedure proc)
     Distributed implementation of a stored procedure CallableStatement.executeQuery() execution.
abstract public  ExecuteUpdateResultdistributedCallableStatementExecuteUpdate(StoredProcedure proc)
     Distributed implementation of a stored procedure CallableStatement.executeUpdate() execution.
public  voiddistributedClosePersistentConnection(String login, long persistentConnectionId)
    
abstract public  voiddistributedCommit(String login, long transactionId)
    
public  voiddistributedFailoverForPersistentConnection(long persistentConnectionId)
     Notify to all members the failover for the specified persistent connection.
public  voiddistributedFailoverForTransaction(long currentTid)
     Notify to all members the failover for the specified transaction.
public  voiddistributedOpenPersistentConnection(String login, long persistentConnectionId)
    
abstract public  voiddistributedReleaseSavepoint(String login, long transactionId, String name)
    
abstract public  voiddistributedRollback(String login, long transactionId)
    
abstract public  voiddistributedRollback(String login, long transactionId, String savepointName)
    
abstract public  voiddistributedSetSavepoint(String login, long transactionId, String name)
    
abstract public  ExecuteResultdistributedStatementExecute(AbstractRequest request)
     Distributed implementation of a Statement.execute() execution.
abstract public  ControllerResultSetdistributedStatementExecuteQuery(SelectRequest request)
     Distributed implementation of a select request execution that returns a ResultSet.
abstract public  ExecuteUpdateResultdistributedStatementExecuteUpdate(AbstractWriteRequest request)
     Distributed implementation of a write request execution.
abstract public  GeneratedKeysResultdistributedStatementExecuteUpdateWithKeys(AbstractWriteRequest request)
     Distributed implementation of a write request execution that returns auto-generated keys.
public  voidenableBackend(DatabaseBackend db)
     Enable a backend that has been previously added to this virtual database and that is in the disabled state.
public  ControllerResultSetexecLocalStatementExecuteQuery(SelectRequest request)
     Performs a local read operation, as opposed to execReadRequest() which attempts to use distributed reads when there is NoMoreBackendException.
public  ExecuteResultexecLocallyCallableStatementExecute(StoredProcedure proc)
    
public  ControllerResultSetexecLocallyCallableStatementExecuteQuery(StoredProcedure proc)
    
abstract public  ControllerResultSetexecRemoteStatementExecuteQuery(SelectRequest request)
     Execute a read request on some remote controller - one in the group.
public  longgetControllerId()
     Returns the unique controller identifier.
public  TracegetLogger()
    
public  longgetNextConnectionId(long id)
    
public  longgetNextRequestId()
    
protected  SerializablegetRequestResultFromFailoverCache(List successfulControllers, long id)
     Fetch the result of a previously executed request from a remote controller failover cache.
public  VirtualDatabasegetVirtualDatabase()
     Returns the vdb value.
public  booleanisDistributedTransaction(long currentTid)
     Test if a transaction has been started on this controller, but initialized by a remote controller.
public  voidlazyTransactionStart(AbstractRequest request)
     Check if the transaction corresponding to the given query has been started remotely and start the transaction locally in a lazy manner if needed.
protected  voidnotifyControllerInconsistency(AbstractRequest request, ArrayList inconsistentControllers)
     Notify controllers that they are now inconsistent with the cluster and that they sould disable themselves.
protected  voidnotifyRequestCompletion(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, ArrayList backendsToNotify)
     Notify a set of backends of the query completion.
Parameters:
  request - the request that has completed
Parameters:
  success - true if the request has successfully completed
Parameters:
  disableBackendOnSuccess - disable all local backends if query wassuccessful (but failed locally).
protected  voidnotifyRequestCompletion(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, ArrayList backendsToNotify, int requestUpdateCount)
     Notify a set of backends of the query completion.
Parameters:
  request - the request that has completed
Parameters:
  success - true if the request has successfully completed
Parameters:
  disableBackendOnSuccess - disable all local backends if query wassuccessful (but failed locally).
public  voidreleaseSavepoint(long transactionId, String name)
    
public  voidresumeActivity()
    
public  voidrollback(long transactionId, boolean logRollback)
    
public  voidrollback(long transactionId, String savepointName)
    
public  voidscheduleExecWriteRequest(AbstractWriteRequest request)
    
public  voidsetControllerId(long id)
     Sets the controller identifier value (this id must be unique).
public  intsetSavepoint(long transactionId)
    
public  voidsetSavepoint(long transactionId, String name)
    
public  voidsetScheduler(AbstractScheduler scheduler)
    
public  ExecuteResultstatementExecute(AbstractRequest request)
    
public  ControllerResultSetstatementExecuteQuery(SelectRequest request)
    
public  ExecuteUpdateResultstatementExecuteUpdate(AbstractWriteRequest request)
    
public  GeneratedKeysResultstatementExecuteUpdateWithKeys(AbstractWriteRequest request)
    
public  booleanstoreRequestResult(AbstractRequest request, Serializable result)
     Stores a result associated with a request in the request result failover cache.
public  voidsuspendActivity()
    

Field Detail
CONTROLLER_ID_BITS
final public static long CONTROLLER_ID_BITS(Code)

See Also:   DistributedRequestManager.CONTROLLER_ID_BIT_MASK



CONTROLLER_ID_BIT_MASK
final public static long CONTROLLER_ID_BIT_MASK(Code)
Effective controllerIds are on the upper 16 bits of a long (64 bits). Distributed transaction ids (longs) are layed out as [ControllerId(16bits) | LocalTransactionId(64bits)].
This constant used in DistributedVirtualDatabase.



CONTROLLER_ID_SHIFT_BITS
final public static int CONTROLLER_ID_SHIFT_BITS(Code)

See Also:   DistributedRequestManager.CONTROLLER_ID_BIT_MASK



SUCCESSFUL_COMPLETION
final public static Integer SUCCESSFUL_COMPLETION(Code)
Constant to acknowledge the successful completion of a distributed query



TRANSACTION_ID_BIT_MASK
final public static long TRANSACTION_ID_BIT_MASK(Code)
TRANSACTION_ID_BIT_MASK is used to get the transaction id local to the originating controller



distributedTransactions
protected LinkedList distributedTransactions(Code)
List of transactions that have executed on multiple controllers



dvdb
protected DistributedVirtualDatabase dvdb(Code)




Constructor Detail
DistributedRequestManager
public DistributedRequestManager(DistributedVirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, RecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout) throws SQLException, NotCompliantMBeanException(Code)
Builds a new DistributedRequestManager instance without cache.
Parameters:
  vdb - the virtual database this request manager belongs to
Parameters:
  scheduler - the Request Scheduler to use
Parameters:
  cache - a Query Cache implementation
Parameters:
  loadBalancer - the Request Load Balancer to use
Parameters:
  recoveryLog - the Log Recovery to use
Parameters:
  beginTimeout - timeout in seconds for begin
Parameters:
  commitTimeout - timeout in seconds for commit
Parameters:
  rollbackTimeout - timeout in seconds for rollback
throws:
  SQLException - if an error occurs
throws:
  NotCompliantMBeanException - if this class is not a compliant JMXMBean




Method Detail
abort
public void abort(long transactionId, boolean logAbort, boolean forceAbort) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.abort(longbooleanboolean)



addFailedOnAllBackends
public void addFailedOnAllBackends(AbstractRequest request, boolean needSchedulerNotification)(Code)
Add a request that failed on all backends.
Parameters:
  request - the request that failed
Parameters:
  needSchedulerNotification - true if the request has been scheduled butthe scheduler has not been notified yet of the request completion
See Also:   DistributedRequestManager.completeFailedOnAllBackends(AbstractRequest,boolean,boolean)



begin
public long begin(String login, boolean isPersistentConnection, long persistentConnectionId) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.begin(Stringbooleanlong)
See Also:    overrides RequestManager.begin(String) to apply bit
See Also:   masks to the tid returned by the scheduler



blockActivity
public void blockActivity() throws SQLException(Code)
Suspend all transactions, writes and persistent connections and do not wait for completion of in-flight transactions and/or persistent connections.

This method blocks activity in the cluster and should not be called in normal cluster situation. It should be reserved for extraordinary situation such as network partition detection & reconciliation.


throws:
  SQLException - if an error occured



callableStatementExecute
public ExecuteResult callableStatementExecute(StoredProcedure proc) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.callableStatementExecute(StoredProcedure)



callableStatementExecuteQuery
public ControllerResultSet callableStatementExecuteQuery(StoredProcedure proc) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.callableStatementExecuteQuery(StoredProcedure)



callableStatementExecuteUpdate
public ExecuteUpdateResult callableStatementExecuteUpdate(StoredProcedure proc) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.callableStatementExecuteUpdate(org.continuent.sequoia.controller.requests.StoredProcedure)



cleanupAllFailedQueriesFromController
public void cleanupAllFailedQueriesFromController(long failedControllerId)(Code)
Cleanup all queries registered as failed issued from the given controller. This is used when a controller has failed and no status information will be returned for failed queries. Queries are systematically tagged as failed.

FIXME: This is only correct with 2 controllers, in a 3+ controller scenario, we need to check from other controllers if someone succeeded.
Parameters:
  failedControllerId - id of the controller that has failed




cleanupRollbackFromOtherController
public void cleanupRollbackFromOtherController(long tId)(Code)
Cleanup all queries from a given transaction that were registered as failed and issued from the other controller. This is used when a controller has failed and no status information will be returned for failed queries. Queries are systematically tagged as failed. This method is called only for failover during a rollback / abort to properly close the transaction on the remaining controller.
Parameters:
  tId - the transaction id that we are looking for



closePersistentConnection
public void closePersistentConnection(Long connectionId)(Code)
Retrieve the vLogin corresponding to the persistent connection id provided and close the connection if found. This is used by the ControllerFailureCleanupThread to cleanup reamining persistent connections from a failed controller whose clients never recovered.
Parameters:
  connectionId - the persistent connection id



commit
public void commit(long transactionId, boolean logCommit, boolean emptyTransaction) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.commit(longbooleanboolean)



completeFailedOnAllBackends
public void completeFailedOnAllBackends(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, int updateCount)(Code)
Notify completion of a request that either failed on all backends or was not executed at all (NoMoreBackendException). If completion was successful and query failed on all backends locally, all local backends are disabled if disabledBackendOnSuccess is true.
Parameters:
  request - request that completed
Parameters:
  success - true if completion is successful
Parameters:
  disableBackendOnSuccess - disable all local backends if query wassuccessful (but failed locally)
Parameters:
  updateCount - request update count to be logged in recovery log
See Also:   DistributedRequestManager.addFailedOnAllBackends(AbstractRequest,boolean)



completeTransaction
public void completeTransaction(Long tid)(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.completeTransaction(java.lang.Long)



disableBackend
public void disableBackend(DatabaseBackend db, boolean forceDisable) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.disableBackend(org.continuent.sequoia.controller.backend.DatabaseBackendboolean)



disableBackendsWithCheckpoint
public void disableBackendsWithCheckpoint(ArrayList backendInfos, String checkpointName) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.disableBackendsWithCheckpoint(java.util.ArrayListjava.lang.String)



distributedAbort
abstract public void distributedAbort(String login, long transactionId) throws SQLException(Code)
Distributed implementation of an abort
Parameters:
  login - login that abort the transaction
Parameters:
  transactionId - id of the commiting transaction
throws:
  SQLException - if an error occurs



distributedCallableStatementExecute
abstract public ExecuteResult distributedCallableStatementExecute(StoredProcedure proc) throws SQLException(Code)
Distributed implementation of a stored procedure CallableStatement.execute() execution.
Parameters:
  proc - stored procedure to execute an ExecuteResult object
throws:
  SQLException - if an error occurs



distributedCallableStatementExecuteQuery
abstract public ControllerResultSet distributedCallableStatementExecuteQuery(StoredProcedure proc) throws SQLException(Code)
Distributed implementation of a stored procedure CallableStatement.executeQuery() execution.
Parameters:
  proc - stored procedure to execute ResultSet corresponding to this stored procedure execution
throws:
  SQLException - if an error occurs



distributedCallableStatementExecuteUpdate
abstract public ExecuteUpdateResult distributedCallableStatementExecuteUpdate(StoredProcedure proc) throws SQLException(Code)
Distributed implementation of a stored procedure CallableStatement.executeUpdate() execution.
Parameters:
  proc - stored procedure to execute number of modified rows
throws:
  SQLException - if an error occurs



distributedClosePersistentConnection
public void distributedClosePersistentConnection(String login, long persistentConnectionId)(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.closePersistentConnection(java.lang.Stringlong)



distributedCommit
abstract public void distributedCommit(String login, long transactionId) throws SQLException(Code)
Distributed implementation of a commit
Parameters:
  login - login that commit the transaction
Parameters:
  transactionId - id of the commiting transaction
throws:
  SQLException - if an error occurs



distributedFailoverForPersistentConnection
public void distributedFailoverForPersistentConnection(long persistentConnectionId)(Code)
Notify to all members the failover for the specified persistent connection.
Parameters:
  persistentConnectionId - persistent connection id
See Also:   org.continuent.sequoia.controller.virtualdatabase.VirtualDatabase.failoverForPersistentConnection(long)



distributedFailoverForTransaction
public void distributedFailoverForTransaction(long currentTid)(Code)
Notify to all members the failover for the specified transaction.
Parameters:
  currentTid - transaction id
See Also:   org.continuent.sequoia.controller.virtualdatabase.VirtualDatabase.failoverForTransaction(long)



distributedOpenPersistentConnection
public void distributedOpenPersistentConnection(String login, long persistentConnectionId) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.openPersistentConnection(Stringlong)



distributedReleaseSavepoint
abstract public void distributedReleaseSavepoint(String login, long transactionId, String name) throws SQLException(Code)
Distributed implementation of releasing a savepoint from a transaction
Parameters:
  login - login that set the savepoint
Parameters:
  transactionId - id of the transaction
Parameters:
  name - name of the savepoint to release
throws:
  SQLException - if an error occurs



distributedRollback
abstract public void distributedRollback(String login, long transactionId) throws SQLException(Code)
Distributed implementation of a rollback
Parameters:
  login - login that rollback the transaction
Parameters:
  transactionId - id of the rollbacking transaction
throws:
  SQLException - if an error occurs



distributedRollback
abstract public void distributedRollback(String login, long transactionId, String savepointName) throws SQLException(Code)
Distributed implementation of a rollback to a savepoint
Parameters:
  login - login that rollback the transaction
Parameters:
  transactionId - id of the transaction
Parameters:
  savepointName - name of the savepoint
throws:
  SQLException - if an error occurs



distributedSetSavepoint
abstract public void distributedSetSavepoint(String login, long transactionId, String name) throws SQLException(Code)
Distributed implementation of setting a savepoint to a transaction
Parameters:
  login - login that releases the savepoint
Parameters:
  transactionId - id of the transaction
Parameters:
  name - name of the savepoint to set
throws:
  SQLException - if an error occurs



distributedStatementExecute
abstract public ExecuteResult distributedStatementExecute(AbstractRequest request) throws SQLException(Code)
Distributed implementation of a Statement.execute() execution.
Parameters:
  request - request to execute an ExecuteResult object
throws:
  SQLException - if an error occurs



distributedStatementExecuteQuery
abstract public ControllerResultSet distributedStatementExecuteQuery(SelectRequest request) throws SQLException(Code)
Distributed implementation of a select request execution that returns a ResultSet.
Parameters:
  request - request to execute ResultSet containing the auto-generated keys.
throws:
  SQLException - if an error occurs



distributedStatementExecuteUpdate
abstract public ExecuteUpdateResult distributedStatementExecuteUpdate(AbstractWriteRequest request) throws SQLException(Code)
Distributed implementation of a write request execution.
Parameters:
  request - request to execute number of modified rows
throws:
  SQLException - if an error occurs



distributedStatementExecuteUpdateWithKeys
abstract public GeneratedKeysResult distributedStatementExecuteUpdateWithKeys(AbstractWriteRequest request) throws SQLException(Code)
Distributed implementation of a write request execution that returns auto-generated keys.
Parameters:
  request - request to execute update count and ResultSet containing the auto-generated keys.
throws:
  SQLException - if an error occurs



enableBackend
public void enableBackend(DatabaseBackend db) throws SQLException(Code)
Enable a backend that has been previously added to this virtual database and that is in the disabled state. We check we the other controllers if this backend must be enabled in read-only or read-write. The current policy is that the first one to enable this backend will have read-write access to it and others will be in read-only.
Parameters:
  db - The database backend to enable
throws:
  SQLException - if an error occurs



execLocalStatementExecuteQuery
public ControllerResultSet execLocalStatementExecuteQuery(SelectRequest request) throws NoMoreBackendException, SQLException(Code)
Performs a local read operation, as opposed to execReadRequest() which attempts to use distributed reads when there is NoMoreBackendException.
Parameters:
  request - the read request to perform a ControllerResultSet
throws:
  NoMoreBackendException - when no more local backends are available toexecute the request
throws:
  SQLException - in case of error



execLocallyCallableStatementExecute
public ExecuteResult execLocallyCallableStatementExecute(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Once the request has been dispatched, it can be executed using the code from RequestManager
Parameters:
  proc - stored procedure to execute ExecuteResult corresponding to this stored procedure execution
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
throws:
  SQLException - if an error occurs



execLocallyCallableStatementExecuteQuery
public ControllerResultSet execLocallyCallableStatementExecuteQuery(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Once the request has been dispatched, it can be executed using the code from RequestManager
Parameters:
  proc - stored procedure to execute ResultSet corresponding to this stored procedure execution
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
throws:
  SQLException - if an error occurs



execRemoteStatementExecuteQuery
abstract public ControllerResultSet execRemoteStatementExecuteQuery(SelectRequest request) throws SQLException(Code)
Execute a read request on some remote controller - one in the group. Used when the local controller has no backend available to execute the request.
Parameters:
  request - the request to execute the query ResultSet
throws:
  SQLException - in case of bad request



getControllerId
public long getControllerId()(Code)
Returns the unique controller identifier. Returns the controllerId.



getLogger
public Trace getLogger()(Code)
Get the trace logger of this DistributedRequestManager a Trace object



getNextConnectionId
public long getNextConnectionId(long id)(Code)
Make the given persistent connection id unique cluster-wide
Parameters:
  id - original id unique connection id



getNextRequestId
public long getNextRequestId()(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.getNextRequestId



getRequestResultFromFailoverCache
protected Serializable getRequestResultFromFailoverCache(List successfulControllers, long id) throws NoResultAvailableException(Code)
Fetch the result of a previously executed request from a remote controller failover cache.
Parameters:
  successfulControllers - controllers to fetch the result from
Parameters:
  id - unique identifier of the query to look the result for the request result
throws:
  NoResultAvailableException - if no result could be retrieved from thefailover cache



getVirtualDatabase
public VirtualDatabase getVirtualDatabase()(Code)
Returns the vdb value. Returns the vdb.



isDistributedTransaction
public boolean isDistributedTransaction(long currentTid)(Code)
Test if a transaction has been started on this controller, but initialized by a remote controller.
Parameters:
  currentTid - Current transaction Id True if this transaction of Id currentId has already been startedon the current controller



lazyTransactionStart
public void lazyTransactionStart(AbstractRequest request) throws SQLException(Code)
Check if the transaction corresponding to the given query has been started remotely and start the transaction locally in a lazy manner if needed. This also checks if a local request must trigger the logging of a 'begin' in the recovery log.
Parameters:
  request - query to execute
throws:
  SQLException - if an error occurs



notifyControllerInconsistency
protected void notifyControllerInconsistency(AbstractRequest request, ArrayList inconsistentControllers) throws SQLException(Code)
Notify controllers that they are now inconsistent with the cluster and that they sould disable themselves.
Parameters:
  request - request that generated the consistency
Parameters:
  inconsistentControllers - controllers that need to be notified
throws:
  SQLException - if an error occurs



notifyRequestCompletion
protected void notifyRequestCompletion(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, ArrayList backendsToNotify) throws SQLException(Code)
Notify a set of backends of the query completion.
Parameters:
  request - the request that has completed
Parameters:
  success - true if the request has successfully completed
Parameters:
  disableBackendOnSuccess - disable all local backends if query wassuccessful (but failed locally). Usually set to true in case ofAllBackendsFailedException and false for NoMoreBackendException.
Parameters:
  backendsToNotify - list of backends to notify (returns right away ifthe list is null)
throws:
  SQLException - if an error occurs



notifyRequestCompletion
protected void notifyRequestCompletion(AbstractRequest request, boolean success, boolean disableBackendOnSuccess, ArrayList backendsToNotify, int requestUpdateCount) throws SQLException(Code)
Notify a set of backends of the query completion.
Parameters:
  request - the request that has completed
Parameters:
  success - true if the request has successfully completed
Parameters:
  disableBackendOnSuccess - disable all local backends if query wassuccessful (but failed locally). Usually set to true in case ofAllBackendsFailedException and false for NoMoreBackendException.
Parameters:
  backendsToNotify - list of backends to notify (returns right away ifthe list is null)
Parameters:
  requestUpdateCount - the request update count to be logged if itsucceeded somewhere
throws:
  SQLException -



releaseSavepoint
public void releaseSavepoint(long transactionId, String name) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.releaseSavepoint(longString)



resumeActivity
public void resumeActivity()(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.resumeActivity



rollback
public void rollback(long transactionId, boolean logRollback) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.rollback(longboolean)



rollback
public void rollback(long transactionId, String savepointName) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.rollback(longString)



scheduleExecWriteRequest
public void scheduleExecWriteRequest(AbstractWriteRequest request) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.scheduleExecWriteRequest(org.continuent.sequoia.controller.requests.AbstractWriteRequest)



setControllerId
public void setControllerId(long id)(Code)
Sets the controller identifier value (this id must be unique). Parameter id must hold on 16 bits (< 0xffff), otherwise an exception is thrown. Effective this.controllerId is not set to passed parameter id, but to id << ControllerIdShiftBits. The reason for all this is that controllerIds are to be carried into ditributed transactions ids, in the upper 16 bits.
Parameters:
  id - The controllerId to set.



setSavepoint
public int setSavepoint(long transactionId) throws SQLException(Code)

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



setSavepoint
public void setSavepoint(long transactionId, String name) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.setSavepoint(longString)



setScheduler
public void setScheduler(AbstractScheduler scheduler)(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.setScheduler(org.continuent.sequoia.controller.scheduler.AbstractScheduler)



statementExecute
public ExecuteResult statementExecute(AbstractRequest request) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.statementExecute(AbstractRequest)



statementExecuteQuery
public ControllerResultSet statementExecuteQuery(SelectRequest request) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.statementExecuteQuery(org.continuent.sequoia.controller.requests.SelectRequest)



statementExecuteUpdate
public ExecuteUpdateResult statementExecuteUpdate(AbstractWriteRequest request) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.statementExecuteUpdate(org.continuent.sequoia.controller.requests.AbstractWriteRequest)



statementExecuteUpdateWithKeys
public GeneratedKeysResult statementExecuteUpdateWithKeys(AbstractWriteRequest request) throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.statementExecuteUpdateWithKeys(org.continuent.sequoia.controller.requests.AbstractWriteRequest)



storeRequestResult
public boolean storeRequestResult(AbstractRequest request, Serializable result)(Code)
Stores a result associated with a request in the request result failover cache.

Only results for requests initiated on a remote controller are stored.
Parameters:
  request - the request executed
Parameters:
  result - the result of the request true if the result was added to the cache, false if the request waslocal to this controller
See Also:   org.continuent.sequoia.controller.virtualdatabase.RequestResultFailoverCache.store(AbstractRequestSerializable)




suspendActivity
public void suspendActivity() throws SQLException(Code)

See Also:   org.continuent.sequoia.controller.requestmanager.RequestManager.suspendActivity



Fields inherited from org.continuent.sequoia.controller.requestmanager.RequestManager
protected BackupManager backupManager(Code)(Java Doc)
protected long beginTimeout(Code)(Java Doc)
protected long commitTimeout(Code)(Java Doc)
protected DatabaseSchema dbs(Code)(Java Doc)
protected static Trace endUserLogger(Code)(Java Doc)
protected AbstractLoadBalancer loadBalancer(Code)(Java Doc)
protected Trace logger(Code)(Java Doc)
protected ParsingCache parsingCache(Code)(Java Doc)
protected RecoveryLog recoveryLog(Code)(Java Doc)
protected int requiredParsingGranularity(Code)(Java Doc)
protected AbstractResultCache resultCache(Code)(Java Doc)
protected long rollbackTimeout(Code)(Java Doc)
protected AbstractScheduler scheduler(Code)(Java Doc)
protected int schedulerParsingranularity(Code)(Java Doc)
protected Hashtable tidSavepoints(Code)(Java Doc)
protected Hashtable transactionMetaDatas(Code)(Java Doc)
protected VirtualDatabase vdb(Code)(Java Doc)

Methods inherited from org.continuent.sequoia.controller.requestmanager.RequestManager
public void abort(long transactionId, boolean logAbort, boolean forceAbort) throws SQLException(Code)(Java Doc)
public void addSavepoint(Long tid, String savepointName)(Code)(Java Doc)
public void backupBackend(DatabaseBackend backend, String login, String password, String dumpName, String backuperName, String path, ArrayList tables) throws SQLException(Code)(Java Doc)
public long begin(String login, boolean isPersistentConnection, long persistentConnectionId) throws SQLException(Code)(Java Doc)
public ExecuteResult callableStatementExecute(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ControllerResultSet callableStatementExecuteQuery(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ExecuteUpdateResult callableStatementExecuteUpdate(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public void closePersistentConnection(String login, long persistentConnectionId)(Code)(Java Doc)
public void commit(long transactionId, boolean logCommit, boolean emptyTransaction) throws SQLException(Code)(Java Doc)
public void completeTransaction(Long tid)(Code)(Java Doc)
public void disableBackend(DatabaseBackend db, boolean forceDisable) throws SQLException(Code)(Java Doc)
public void disableBackendWithCheckpoint(DatabaseBackend db, String checkpointName) throws SQLException(Code)(Java Doc)
public void disableBackendsWithCheckpoint(ArrayList backendInfos, String checkpointName) throws SQLException(Code)(Java Doc)
public void doBegin(String login, long tid, boolean isPersistentConnection, long persistentConnectionId) throws SQLException(Code)(Java Doc)
public void enableBackend(DatabaseBackend db) throws SQLException(Code)(Java Doc)
public RecoverThread enableBackendFromCheckpoint(DatabaseBackend db, String checkpointName) throws SQLException(Code)(Java Doc)
public String getAssociatedString()(Code)(Java Doc)
public BackendStateListener getBackendStateListener()(Code)(Java Doc)
public BackupManager getBackupManager()(Code)(Java Doc)
public long getBeginTimeout()(Code)(Java Doc)
public int getCacheParsingranularity()(Code)(Java Doc)
public long getCommitTimeout()(Code)(Java Doc)
public synchronized DatabaseSchema getDatabaseSchema()(Code)(Java Doc)
public AbstractLoadBalancer getLoadBalancer()(Code)(Java Doc)
public MetadataCache getMetadataCache()(Code)(Java Doc)
public long getNextRequestId()(Code)(Java Doc)
public int getNumberOfSavepointsInTransaction(long tId)(Code)(Java Doc)
public void getParsingFromCacheOrParse(AbstractRequest request) throws SQLException(Code)(Java Doc)
public ControllerResultSet getPreparedStatementGetMetaData(AbstractRequest request) throws SQLException(Code)(Java Doc)
public RecoveryLog getRecoveryLog()(Code)(Java Doc)
public int getRequiredParsingGranularity()(Code)(Java Doc)
public AbstractResultCache getResultCache()(Code)(Java Doc)
public long getRollbackTimeout()(Code)(Java Doc)
public AbstractScheduler getScheduler()(Code)(Java Doc)
public int getSchedulerParsingranularity()(Code)(Java Doc)
public TransactionMetaData getTransactionMetaData(Long tid) throws SQLException(Code)(Java Doc)
public VirtualDatabase getVirtualDatabase()(Code)(Java Doc)
public String getXml()(Code)(Java Doc)
public boolean hasPersistentConnection(long persistentConnectionId)(Code)(Java Doc)
public boolean hasSavepoint(Long tid, String savepointName)(Code)(Java Doc)
public void initBackendsLastKnownCheckpointFromRecoveryLog()(Code)(Java Doc)
public void initializeRequestId(long requestId)(Code)(Java Doc)
public boolean isCaseSensitiveParsing()(Code)(Java Doc)
public boolean isStaticSchema()(Code)(Java Doc)
public ExecuteResult loadBalanceCallableStatementExecute(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ControllerResultSet loadBalanceCallableStatementExecuteQuery(StoredProcedure proc) throws SQLException, AllBackendsFailedException(Code)(Java Doc)
public ExecuteUpdateResult loadBalanceCallableStatementExecuteUpdate(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ExecuteResult loadBalanceStatementExecute(AbstractRequest request) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ExecuteUpdateResult loadBalanceStatementExecuteUpdate(AbstractWriteRequest request) throws AllBackendsFailedException, NoMoreBackendException, SQLException(Code)(Java Doc)
public GeneratedKeysResult loadBalanceStatementExecuteUpdateWithKeys(AbstractWriteRequest request) throws AllBackendsFailedException, NoMoreBackendException, SQLException(Code)(Java Doc)
public void logLazyTransactionBegin(long transactionId) throws SQLException(Code)(Java Doc)
public synchronized void mergeDatabaseSchema(DatabaseSchema backendSchema)(Code)(Java Doc)
public void openPersistentConnection(String login, long persistentConnectionId, DistributedOpenPersistentConnection dmsg) throws SQLException(Code)(Java Doc)
public String parseSqlRequest(String sqlRequest, String lineSeparator)(Code)(Java Doc)
public void releaseSavepoint(long transactionId, String name) throws SQLException(Code)(Java Doc)
public void removeCheckpoint(String checkpointName)(Code)(Java Doc)
public void removeSavepoint(Long tid, String savepointName)(Code)(Java Doc)
public void removeSavepoints(Long tid, String savepointName)(Code)(Java Doc)
public void restoreBackendFromBackupCheckpoint(DatabaseBackend backend, String login, String password, String dumpName, ArrayList tables) throws BackupException(Code)(Java Doc)
public void resumeActivity()(Code)(Java Doc)
public void rollback(long transactionId, boolean logRollback) throws SQLException(Code)(Java Doc)
public void rollback(long transactionId, String savepointName) throws SQLException(Code)(Java Doc)
public void scheduleExecWriteRequest(AbstractWriteRequest request) throws SQLException(Code)(Java Doc)
public void scheduleStoredProcedure(StoredProcedure proc) throws SQLException(Code)(Java Doc)
public void setBackupManager(BackupManager currentBackupManager)(Code)(Java Doc)
public void setCacheParsingranularity(int cacheParsingranularity)(Code)(Java Doc)
public void setCaseSensitiveParsing(boolean isCaseSensitiveParsing)(Code)(Java Doc)
public synchronized void setDatabaseSchema(DatabaseSchema schema, boolean isStatic)(Code)(Java Doc)
public void setLoadBalancer(AbstractLoadBalancer loadBalancer)(Code)(Java Doc)
public void setMetadataCache(MetadataCache metadataCache)(Code)(Java Doc)
public void setParsingCache(ParsingCache parsingCache)(Code)(Java Doc)
public void setRecoveryLog(RecoveryLog recoveryLog)(Code)(Java Doc)
public void setResultCache(AbstractResultCache cache)(Code)(Java Doc)
public int setSavepoint(long transactionId) throws SQLException(Code)(Java Doc)
public void setSavepoint(long transactionId, String name) throws SQLException(Code)(Java Doc)
public void setScheduler(AbstractScheduler scheduler)(Code)(Java Doc)
public void setSchedulerParsingranularity(int schedulerParsingranularity)(Code)(Java Doc)
public synchronized void setSchemaIsDirty(boolean schemaIsDirty)(Code)(Java Doc)
public void setStaticSchema(boolean schemaIsStatic)(Code)(Java Doc)
public ExecuteResult statementExecute(AbstractRequest request) throws AllBackendsFailedException, SQLException(Code)(Java Doc)
public ControllerResultSet statementExecuteQuery(SelectRequest request) throws SQLException(Code)(Java Doc)
public ExecuteUpdateResult statementExecuteUpdate(AbstractWriteRequest request) throws SQLException(Code)(Java Doc)
public GeneratedKeysResult statementExecuteUpdateWithKeys(AbstractWriteRequest request) throws SQLException(Code)(Java Doc)
public void storeBackendsInfo(String databaseName, ArrayList backends)(Code)(Java Doc)
public void suspendActivity() throws SQLException(Code)(Java Doc)
public void updateAndNotifyExecWriteRequest(AbstractWriteRequest request, int updateCount) throws SQLException(Code)(Java Doc)
public void updateRecoveryLogFlushCacheAndRefreshSchema(StoredProcedure proc) throws SQLException(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.