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


org.continuent.sequoia.controller.jmx.AbstractStandardMBean
   org.continuent.sequoia.controller.requestmanager.RequestManager

All known Subclasses:   org.continuent.sequoia.controller.requestmanager.distributed.DistributedRequestManager,
RequestManager
public class RequestManager extends AbstractStandardMBean implements XmlComponent,RequestManagerMBean(Code)
This class defines the Request Manager.

The RM is composed of a Request Scheduler, an optional Query Cache, and a Load Balancer and an optional Recovery Log.
author:
   Emmanuel Cecchet
author:
   Julie Marguerite
author:
   Nicolas Modrzyk
author:
   Vadim Kassin
author:
   Jean-Bernard van Zuylen
author:
  

version:
   1.0



Field Summary
protected  BackupManagerbackupManager
    
protected  longbeginTimeout
    
protected  longcommitTimeout
    
protected  DatabaseSchemadbs
    
protected static  TraceendUserLogger
    
protected  AbstractLoadBalancerloadBalancer
    
protected  Tracelogger
    
protected  ParsingCacheparsingCache
    
protected  RecoveryLogrecoveryLog
    
protected  intrequiredParsingGranularity
    
protected  AbstractResultCacheresultCache
    
protected  longrollbackTimeout
    
protected  AbstractSchedulerscheduler
    
protected  intschedulerParsingranularity
    
protected  HashtabletidSavepoints
     Hashtable<Long, String>, the Long being a transaction ID and its corresponding String being the name of a savepoint.
protected  HashtabletransactionMetaDatas
     Hashtable<Long, TransactionMetaData>, the Long key is the same transaction ID as the transactionId field of its corresponding TransactionMetaData value.
protected  VirtualDatabasevdb
    

Constructor Summary
public  RequestManager(VirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, RecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout)
     Creates a new RequestManager instance.

Method Summary
public  voidabort(long transactionId, boolean logAbort, boolean forceAbort)
     Abort a transaction that has been started but in which no query was executed.
public  voidaddSavepoint(Long tid, String savepointName)
    
public  voidbackupBackend(DatabaseBackend backend, String login, String password, String dumpName, String backuperName, String path, ArrayList tables)
     Create a backup from the content of a backend.
public  longbegin(String login, boolean isPersistentConnection, long persistentConnectionId)
     Begin a new transaction and return the corresponding transaction identifier.
public  ExecuteResultcallableStatementExecute(StoredProcedure proc)
     Execute a call to CallableStatement.execute() and returns a suite of updateCount and/or ResultSets.
public  ControllerResultSetcallableStatementExecuteQuery(StoredProcedure proc)
     Call a stored procedure that returns a ResultSet.
public  ExecuteUpdateResultcallableStatementExecuteUpdate(StoredProcedure proc)
     Call a stored procedure that performs an update.
public  voidclosePersistentConnection(String login, long persistentConnectionId)
     Close the given persistent connection.
public  voidcommit(long transactionId, boolean logCommit, boolean emptyTransaction)
     Commit a transaction given its id.
public  voidcompleteTransaction(Long tid)
     Complete the transaction by removing it from the transactionMetaDatas.
public  voiddisableBackend(DatabaseBackend db, boolean forceDisable)
     Disable a backend that is currently enabled on this virtual database.
public  voiddisableBackendWithCheckpoint(DatabaseBackend db, String checkpointName)
     The backend must belong to this virtual database and be in the enabled state.
public  voiddisableBackendsWithCheckpoint(ArrayList backendInfos, String checkpointName)
     Disable a list of backends.
public  voiddoBegin(String login, long tid, boolean isPersistentConnection, long persistentConnectionId)
     Begins a new transaction for the given login and tid.
public  voidenableBackend(DatabaseBackend db)
     Enable a backend that has been previously added to this virtual database and that is in the disabled state.
public  RecoverThreadenableBackendFromCheckpoint(DatabaseBackend db, String checkpointName)
     The backend must have been previously added to this virtual database and be in the disabled state.

All the queries since the given checkpoint are played and the backend state is set to enabled when it is completely synchronized.

Note that the job is performed in background by a RecoverThread.

public  StringgetAssociatedString()
    
public  BackendStateListenergetBackendStateListener()
     Returns the backendStateListener value.
public  BackupManagergetBackupManager()
     Returns the backupManager value.
public  longgetBeginTimeout()
     Returns the beginTimeout value.
public  intgetCacheParsingranularity()
     Returns the cacheParsingranularity value.
public  longgetCommitTimeout()
     Returns the commitTimeout value.
public synchronized  DatabaseSchemagetDatabaseSchema()
     Get the DatabaseSchema used by this Request Manager.
public  AbstractLoadBalancergetLoadBalancer()
     Get the Request Load Balancer used in this Request Controller.
public  MetadataCachegetMetadataCache()
     Returns the metadataCache value.
public  longgetNextRequestId()
     Return the next request identifier (monotically increasing number).
public  intgetNumberOfSavepointsInTransaction(long tId)
    
public  voidgetParsingFromCacheOrParse(AbstractRequest request)
     Get the parsing from the parsing cache or parse the query.
public  ControllerResultSetgetPreparedStatementGetMetaData(AbstractRequest request)
    
public  RecoveryLoggetRecoveryLog()
     Returns the Recovery Log Manager.
public  intgetRequiredParsingGranularity()
     Returns the requiredParsingGranularity value.
public  AbstractResultCachegetResultCache()
     Get the result cache (if any) used in this Request Manager.
public  longgetRollbackTimeout()
     Returns the rollbackTimeout value.
public  AbstractSchedulergetScheduler()
     Get the Request Scheduler (if any) used in this Request Controller.
public  intgetSchedulerParsingranularity()
     Returns the schedulerParsingranularity value.
public  TransactionMetaDatagetTransactionMetaData(Long tid)
     Get the TransactionMetaData for the given transaction id.
public  VirtualDatabasegetVirtualDatabase()
     Returns the vdb value.
public  StringgetXml()
    
public  booleanhasPersistentConnection(long persistentConnectionId)
     Returns true if the virtual database has opened the given persistent connection.
public  booleanhasSavepoint(Long tid, String savepointName)
    
public  voidinitBackendsLastKnownCheckpointFromRecoveryLog()
     Retrieve the last known checkpoint from the recovery log and set it for each backend.
public  voidinitializeRequestId(long requestId)
     Initialize the request id with the given value (usually retrieved from the recovery log).
public  booleanisCaseSensitiveParsing()
     Returns the isCaseSensitiveParsing value.
public  booleanisStaticSchema()
     Returns the schemaIsStatic value.
public  ExecuteResultloadBalanceCallableStatementExecute(StoredProcedure proc)
     Execute a write stored procedure on the load balancer.
public  ControllerResultSetloadBalanceCallableStatementExecuteQuery(StoredProcedure proc)
     Execute a read stored procedure on the load balancer.
public  ExecuteUpdateResultloadBalanceCallableStatementExecuteUpdate(StoredProcedure proc)
     Execute a write stored procedure on the load balancer.
public  ExecuteResultloadBalanceStatementExecute(AbstractRequest request)
     Execute a request using Statement.execute() on the load balancer.
public  ExecuteUpdateResultloadBalanceStatementExecuteUpdate(AbstractWriteRequest request)
     Send the given query to the load balancer.
public  GeneratedKeysResultloadBalanceStatementExecuteUpdateWithKeys(AbstractWriteRequest request)
     Send the given query to the load balancer.
public  voidlogLazyTransactionBegin(long transactionId)
     Log the begin of a transaction that is started lazily.
public synchronized  voidmergeDatabaseSchema(DatabaseSchema backendSchema)
     Merge the given schema with the existing database schema.
public  voidopenPersistentConnection(String login, long persistentConnectionId, DistributedOpenPersistentConnection dmsg)
     Open the given persistent connection.
public  StringparseSqlRequest(String sqlRequest, String lineSeparator)
    
public  voidreleaseSavepoint(long transactionId, String name)
     Releases a savepoint given its name from a transaction given its id.
public  voidremoveCheckpoint(String checkpointName)
    
public  voidremoveSavepoint(Long tid, String savepointName)
    
public  voidremoveSavepoints(Long tid, String savepointName)
    
public  voidrestoreBackendFromBackupCheckpoint(DatabaseBackend backend, String login, String password, String dumpName, ArrayList tables)
     Restore a dump on a specific backend.
public  voidresumeActivity()
     Resume all transactions, writes and persistent connections.
public  voidrollback(long transactionId, boolean logRollback)
     Rollback a transaction given its id.
public  voidrollback(long transactionId, String savepointName)
     Rollback a transaction given its id to a savepoint given its name.
public  voidscheduleExecWriteRequest(AbstractWriteRequest request)
     Schedule a request for execution.
public  voidscheduleStoredProcedure(StoredProcedure proc)
     This method does some sanity check on the given stored procedure and then tries to schedule it.
public  voidsetBackupManager(BackupManager currentBackupManager)
    
public  voidsetCacheParsingranularity(int cacheParsingranularity)
     Sets the cacheParsingranularity value.
public  voidsetCaseSensitiveParsing(boolean isCaseSensitiveParsing)
     Sets the parsing case sensitivity.
public synchronized  voidsetDatabaseSchema(DatabaseSchema schema, boolean isStatic)
     Sets the DatabaseSchema to be able to parse the requests and find dependencies.
public  voidsetLoadBalancer(AbstractLoadBalancer loadBalancer)
     Set the Request Load Balancer to use in this Request Controller.
public  voidsetMetadataCache(MetadataCache metadataCache)
     Sets the metadataCache value.
public  voidsetParsingCache(ParsingCache parsingCache)
     Sets the ParsingCache.
public  voidsetRecoveryLog(RecoveryLog recoveryLog)
     Sets the Recovery Log Manager.
public  voidsetResultCache(AbstractResultCache cache)
     Set the Request Cache to use in this Request Controller.
public  intsetSavepoint(long transactionId)
     Sets a unnamed savepoint to a transaction given its id.
public  voidsetSavepoint(long transactionId, String name)
     Sets a savepoint given its desired name to a transaction given its id.
public  voidsetScheduler(AbstractScheduler scheduler)
     Set the Request Scheduler to use in this Request Controller.
public  voidsetSchedulerParsingranularity(int schedulerParsingranularity)
     Sets the schedulerParsingranularity value.
public synchronized  voidsetSchemaIsDirty(boolean schemaIsDirty)
     Sets the schemaIsDirty value if the backend schema needs to be refreshed.
public  voidsetStaticSchema(boolean schemaIsStatic)
     Sets the schemaIsStatic value.
public  ExecuteResultstatementExecute(AbstractRequest request)
     Execute a call to CallableStatement.execute() and returns a suite of updateCount and/or ResultSets.
public  ControllerResultSetstatementExecuteQuery(SelectRequest request)
     Perform a read request and return the reply.
public  ExecuteUpdateResultstatementExecuteUpdate(AbstractWriteRequest request)
     Perform a write request and return the number of rows affected Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
public  GeneratedKeysResultstatementExecuteUpdateWithKeys(AbstractWriteRequest request)
     Perform a write request and return the auto generated keys.
public  voidstoreBackendsInfo(String databaseName, ArrayList backends)
    
public  voidsuspendActivity()
     Suspend all transactions, writes and persistent connections.
public  voidupdateAndNotifyExecWriteRequest(AbstractWriteRequest request, int updateCount)
     Update the recovery log, cache, update the database schema if needed and finally notify the scheduler.
public  voidupdateRecoveryLogFlushCacheAndRefreshSchema(StoredProcedure proc)
     Update the recovery log with successful completion of the query, flush the cache and force schema refresh if needed.

Field Detail
backupManager
protected BackupManager backupManager(Code)
The backup manager responsible for backup and restore of backends



beginTimeout
protected long beginTimeout(Code)
begin timeout in ms



commitTimeout
protected long commitTimeout(Code)
commit timeout in ms



dbs
protected DatabaseSchema dbs(Code)



endUserLogger
protected static Trace endUserLogger(Code)



loadBalancer
protected AbstractLoadBalancer loadBalancer(Code)
The request load balancer to use to send requests to the databases



logger
protected Trace logger(Code)



parsingCache
protected ParsingCache parsingCache(Code)



recoveryLog
protected RecoveryLog recoveryLog(Code)
An optional recovery log



requiredParsingGranularity
protected int requiredParsingGranularity(Code)



resultCache
protected AbstractResultCache resultCache(Code)
An optional request cache to cache responses to SQL requests



rollbackTimeout
protected long rollbackTimeout(Code)
rollback timeout in ms



scheduler
protected AbstractScheduler scheduler(Code)
The request scheduler to order and schedule requests



schedulerParsingranularity
protected int schedulerParsingranularity(Code)



tidSavepoints
protected Hashtable tidSavepoints(Code)
Hashtable<Long, String>, the Long being a transaction ID and its corresponding String being the name of a savepoint.



transactionMetaDatas
protected Hashtable transactionMetaDatas(Code)
Hashtable<Long, TransactionMetaData>, the Long key is the same transaction ID as the transactionId field of its corresponding TransactionMetaData value.



vdb
protected VirtualDatabase vdb(Code)
The virtual database owning this Request Manager




Constructor Detail
RequestManager
public RequestManager(VirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, RecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout) throws SQLException, NotCompliantMBeanException(Code)
Creates a new RequestManager instance.
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 the MBean is not JMX compliant




Method Detail
abort
public void abort(long transactionId, boolean logAbort, boolean forceAbort) throws SQLException(Code)
Abort a transaction that has been started but in which no query was executed. As we use lazy transaction begin, there is no need to rollback such transaction but just to cleanup the metadata associated with this not effectively started transaction.
Parameters:
  transactionId - id of the transaction to abort
Parameters:
  logAbort - true if the abort (in fact rollback) should be logged inthe recovery log
Parameters:
  forceAbort - true if the abort will be forced. Actually, abort will donothing when a transaction has savepoints (we do not abort thewhole transaction, so that the user can rollback to a previoussavepoint), except when the connection is closed. In this lastcase, if the transaction is not aborted, it prevents futuremaintenance operations such as shutdowns, enable/disable fromcompleting, so we have to force this abort operation. It alsoapplies to the DeadlockDetectionThread and the cleanup of theVirtualDatabaseWorkerThread.
throws:
  SQLException - if an error occurs



addSavepoint
public void addSavepoint(Long tid, String savepointName)(Code)
Adds a given savepoint to a given transaction
Parameters:
  tid - transaction id
Parameters:
  savepointName - name of the savepoint



backupBackend
public void backupBackend(DatabaseBackend backend, String login, String password, String dumpName, String backuperName, String path, ArrayList tables) throws SQLException(Code)
Create a backup from the content of a backend.
Parameters:
  backend - the target backend to backup
Parameters:
  login - the login to use to connect to the database for the backupoperation
Parameters:
  password - the password to use to connect to the database for thebackup operation
Parameters:
  dumpName - the name of the dump to create
Parameters:
  backuperName - the logical name of the backuper to use
Parameters:
  path - the path where to store the dump
Parameters:
  tables - the list of tables to backup, null means all tables
throws:
  SQLException - if the backup fails



begin
public long begin(String login, boolean isPersistentConnection, long persistentConnectionId) throws SQLException(Code)
Begin a new transaction and return the corresponding transaction identifier. This method is called from the driver when setAutoCommit(false) is called.

Note that the transaction begin is not logged in the recovery log by this method, you will have to call logLazyTransactionBegin.
Parameters:
  login - the login used by the connection
Parameters:
  isPersistentConnection - true if the transaction is started on apersistent connection
Parameters:
  persistentConnectionId - persistent connection id if the transactionmust be started on a persistent connection long a unique transaction identifier
throws:
  SQLException - if an error occurs
See Also:   RequestManager.logLazyTransactionBegin(long)




callableStatementExecute
public ExecuteResult callableStatementExecute(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Execute a call to CallableStatement.execute() and returns a suite of updateCount and/or ResultSets.
Parameters:
  proc - the stored procedure to execute an ExecuteResult object
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
exception:
  SQLException - if an error occurs



callableStatementExecuteQuery
public ControllerResultSet callableStatementExecuteQuery(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Call a stored procedure that returns a ResultSet.
Parameters:
  proc - the stored procedure call a ControllerResultSet value
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
exception:
  SQLException - if an error occurs



callableStatementExecuteUpdate
public ExecuteUpdateResult callableStatementExecuteUpdate(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Call a stored procedure that performs an update.
Parameters:
  proc - the stored procedure call number of rows affected
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
exception:
  SQLException - if an error occurs



closePersistentConnection
public void closePersistentConnection(String login, long persistentConnectionId)(Code)
Close the given persistent connection.
Parameters:
  login - login to use to retrieve the right connection pool
Parameters:
  persistentConnectionId - id of the persistent connection to close



commit
public void commit(long transactionId, boolean logCommit, boolean emptyTransaction) throws SQLException(Code)
Commit a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  logCommit - true if the commit should be logged in the recovery log
Parameters:
  emptyTransaction - true if this transaction has not executed anyrequest
throws:
  SQLException - if an error occurs



completeTransaction
public void completeTransaction(Long tid)(Code)
Complete the transaction by removing it from the transactionMetaDatas.
Parameters:
  tid - transaction id



disableBackend
public void disableBackend(DatabaseBackend db, boolean forceDisable) throws SQLException(Code)
Disable a backend that is currently enabled on this virtual database.

The backend is disabled without further check.

The load balancer disabled method is called on the specified backend.
Parameters:
  db - The database backend to disable
Parameters:
  forceDisable - true if disabling must be forced on the backend
throws:
  SQLException - if an error occurs




disableBackendWithCheckpoint
public void disableBackendWithCheckpoint(DatabaseBackend db, String checkpointName) throws SQLException(Code)
The backend must belong to this virtual database and be in the enabled state. A checkpoint is stored with the given name and the backend is set to the disabling state. The method then wait for all in-flight transactions to complete before disabling completely the backend and storing its last known checkpoint (upon success only).
Parameters:
  db - The database backend to disable
Parameters:
  checkpointName - The checkpoint name to store
throws:
  SQLException - if an error occurs



disableBackendsWithCheckpoint
public void disableBackendsWithCheckpoint(ArrayList backendInfos, String checkpointName) throws SQLException(Code)
Disable a list of backends. Only to store only one checkpoint, and to disable all the backends at the same time so the the system is in a coherent state. Consider only the backends that were enabled. The others are left in the state they were before.
Parameters:
  backendInfos - a List of BackendInfo to disable
Parameters:
  checkpointName - to store
throws:
  SQLException - if an error occurs



doBegin
public void doBegin(String login, long tid, boolean isPersistentConnection, long persistentConnectionId) throws SQLException(Code)
Begins a new transaction for the given login and tid. Informs the loadbalancer and the scheduler about this begun transaction.
Parameters:
  login - the login used by the connection
Parameters:
  tid - the tid associed with the transaction to begin
Parameters:
  isPersistentConnection - true if the transaction is started on apersistent connection
Parameters:
  persistentConnectionId - persistent connection id if the transactionmust be started on a persistent connection
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.

The backend is enabled without further check.

The enableBackend method of the load balancer is called.
Parameters:
  db - The database backend to enable
throws:
  SQLException - if an error occurs




enableBackendFromCheckpoint
public RecoverThread enableBackendFromCheckpoint(DatabaseBackend db, String checkpointName) throws SQLException(Code)
The backend must have been previously added to this virtual database and be in the disabled state.

All the queries since the given checkpoint are played and the backend state is set to enabled when it is completely synchronized.

Note that the job is performed in background by a RecoverThread. You can synchronize on thread termination if you need to wait for completion of this task and listen to JMX notifications for the success status.
Parameters:
  db - The database backend to enable
Parameters:
  checkpointName - The checkpoint name to restart from the JDBC reocver thread synchronizing the backend
throws:
  SQLException - if an error occurs




getAssociatedString
public String getAssociatedString()(Code)

See Also:   org.continuent.sequoia.controller.jmx.AbstractStandardMBean.getAssociatedString



getBackendStateListener
public BackendStateListener getBackendStateListener()(Code)
Returns the backendStateListener value. Returns the backendStateListener.



getBackupManager
public BackupManager getBackupManager()(Code)
Returns the backupManager value. Returns the backupManager.



getBeginTimeout
public long getBeginTimeout()(Code)
Returns the beginTimeout value. Returns the beginTimeout.



getCacheParsingranularity
public int getCacheParsingranularity()(Code)
Returns the cacheParsingranularity value. Returns the cacheParsingranularity.



getCommitTimeout
public long getCommitTimeout()(Code)
Returns the commitTimeout value. Returns the commitTimeout.



getDatabaseSchema
public synchronized DatabaseSchema getDatabaseSchema()(Code)
Get the DatabaseSchema used by this Request Manager. a DatabaseSchema value



getLoadBalancer
public AbstractLoadBalancer getLoadBalancer()(Code)
Get the Request Load Balancer used in this Request Controller. an AbstractLoadBalancer value



getMetadataCache
public MetadataCache getMetadataCache()(Code)
Returns the metadataCache value. Returns the metadataCache.



getNextRequestId
public long getNextRequestId()(Code)
Return the next request identifier (monotically increasing number). a request identifier



getNumberOfSavepointsInTransaction
public int getNumberOfSavepointsInTransaction(long tId)(Code)
Returns the number of savepoints that are defined for a given transaction
Parameters:
  tId - the transaction id the number of savepoints that are defined in the transaction whoseid is tId



getParsingFromCacheOrParse
public void getParsingFromCacheOrParse(AbstractRequest request) throws SQLException(Code)
Get the parsing from the parsing cache or parse the query.
Parameters:
  request - the request to be parsed (request will be parsed after thiscall)
throws:
  SQLException - if an error occurs during parsing



getPreparedStatementGetMetaData
public ControllerResultSet getPreparedStatementGetMetaData(AbstractRequest request) throws SQLException(Code)
Return a ControllerResultSet containing the PreparedStatement metaData of the given sql template
Parameters:
  request - the request containing the sql template an empty ControllerResultSet with the metadata
throws:
  SQLException - if a database error occurs



getRecoveryLog
public RecoveryLog getRecoveryLog()(Code)
Returns the Recovery Log Manager. RecoveryLog the current recovery log (null if none)



getRequiredParsingGranularity
public int getRequiredParsingGranularity()(Code)
Returns the requiredParsingGranularity value. Returns the requiredParsingGranularity.



getResultCache
public AbstractResultCache getResultCache()(Code)
Get the result cache (if any) used in this Request Manager. an AbstractResultCache value or null if no ReqsultCache has been defined



getRollbackTimeout
public long getRollbackTimeout()(Code)
Returns the rollbackTimeout value. Returns the rollbackTimeout.



getScheduler
public AbstractScheduler getScheduler()(Code)
Get the Request Scheduler (if any) used in this Request Controller. an AbstractScheduler value or null if no RequestScheduler has been defined



getSchedulerParsingranularity
public int getSchedulerParsingranularity()(Code)
Returns the schedulerParsingranularity value. Returns the schedulerParsingranularity.



getTransactionMetaData
public TransactionMetaData getTransactionMetaData(Long tid) throws SQLException(Code)
Get the TransactionMetaData for the given transaction id.
Parameters:
  tid - transaction id the TransactionMetaData
throws:
  SQLException - if no marker has been found for this transaction



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



getXml
public String getXml()(Code)
Get xml information about this Request Manager String in xml formatted text



hasPersistentConnection
public boolean hasPersistentConnection(long persistentConnectionId)(Code)
Returns true if the virtual database has opened the given persistent connection.
Parameters:
  persistentConnectionId - id of the persistent connection to check true if the connection is open



hasSavepoint
public boolean hasSavepoint(Long tid, String savepointName)(Code)
Check if a given savepoint has been set for a given transaction
Parameters:
  tid - transaction id
Parameters:
  savepointName - name of the savepoint true if the savepoint exists



initBackendsLastKnownCheckpointFromRecoveryLog
public void initBackendsLastKnownCheckpointFromRecoveryLog()(Code)
Retrieve the last known checkpoint from the recovery log and set it for each backend.



initializeRequestId
public void initializeRequestId(long requestId)(Code)
Initialize the request id with the given value (usually retrieved from the recovery log).
Parameters:
  requestId - new current request identifier



isCaseSensitiveParsing
public boolean isCaseSensitiveParsing()(Code)
Returns the isCaseSensitiveParsing value. Returns the isCaseSensitiveParsing.



isStaticSchema
public boolean isStaticSchema()(Code)
Returns the schemaIsStatic value. Returns the schemaIsStatic.



loadBalanceCallableStatementExecute
public ExecuteResult loadBalanceCallableStatementExecute(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Execute a write stored procedure on the load balancer. Note that we flush the cache before calling the load balancer.
Parameters:
  proc - the stored procedure to call an ExecuteResult object
throws:
  SQLException - if an error occurs
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure



loadBalanceCallableStatementExecuteQuery
public ControllerResultSet loadBalanceCallableStatementExecuteQuery(StoredProcedure proc) throws SQLException, AllBackendsFailedException(Code)
Execute a read stored procedure on the load balancer. Note that we flush the cache before calling the load balancer.
Parameters:
  proc - the stored procedure to call the corresponding ControllerResultSet
throws:
  SQLException - if an error occurs
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure



loadBalanceCallableStatementExecuteUpdate
public ExecuteUpdateResult loadBalanceCallableStatementExecuteUpdate(StoredProcedure proc) throws AllBackendsFailedException, SQLException(Code)
Execute a write stored procedure on the load balancer. Note that we flush the cache before calling the load balancer.
Parameters:
  proc - the stored procedure to call the number of updated rows
throws:
  SQLException - if an error occurs
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure



loadBalanceStatementExecute
public ExecuteResult loadBalanceStatementExecute(AbstractRequest request) throws AllBackendsFailedException, SQLException(Code)
Execute a request using Statement.execute() on the load balancer. Note that we flush the cache before calling the load balancer.
Parameters:
  request - the request to execute. an ExecuteResult object
throws:
  SQLException - if an error occurs
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure



loadBalanceStatementExecuteUpdate
public ExecuteUpdateResult loadBalanceStatementExecuteUpdate(AbstractWriteRequest request) throws AllBackendsFailedException, NoMoreBackendException, SQLException(Code)
Send the given query to the load balancer. If the request fails, the scheduler is properly notified.
Parameters:
  request - the request to execute
throws:
  AllBackendsFailedException - if all backends failed to execute thequery
exception:
  NoMoreBackendException - if no backends are left to execute therequest
throws:
  SQLException - if an error occurs number of modified lines



loadBalanceStatementExecuteUpdateWithKeys
public GeneratedKeysResult loadBalanceStatementExecuteUpdateWithKeys(AbstractWriteRequest request) throws AllBackendsFailedException, NoMoreBackendException, SQLException(Code)
Send the given query to the load balancer. If the request fails, the scheduler is properly notified.
Parameters:
  request - the request to execute update count and auto-generated keys
throws:
  AllBackendsFailedException - if all backends failed to execute thequery
throws:
  NoMoreBackendException - if no backends are left to execute therequest
throws:
  SQLException - if an error occurs



logLazyTransactionBegin
public void logLazyTransactionBegin(long transactionId) throws SQLException(Code)
Log the begin of a transaction that is started lazily. In fact, we just log the begin when we execute the first write request in a transaction to prevent logging begin/commit for read-only transactions. This also prevents a problem with backends that are disabled with a checkpoint when no request has been played in the transaction but the begin statement has already been logged. In that case, the transaction would not be properly replayed at restore time.
Parameters:
  transactionId - the transaction id begin to log
throws:
  SQLException - if an error occurs



mergeDatabaseSchema
public synchronized void mergeDatabaseSchema(DatabaseSchema backendSchema)(Code)
Merge the given schema with the existing database schema.
Parameters:
  backendSchema - The virtual database schema to merge.



openPersistentConnection
public void openPersistentConnection(String login, long persistentConnectionId, DistributedOpenPersistentConnection dmsg) throws SQLException(Code)
Open the given persistent connection.
Parameters:
  login - login to use to retrieve the right connection pool
Parameters:
  persistentConnectionId - id of the persistent connection to open
Parameters:
  dmsg - message in the total order queue if applicable (null otherwise)
throws:
  SQLException - An exception can be thrown when it failed to open aconnection



parseSqlRequest
public String parseSqlRequest(String sqlRequest, String lineSeparator)(Code)

See Also:   org.continuent.sequoia.common.jmx.mbeans.RequestManagerMBean.parseSqlRequest(java.lang.Stringjava.lang.String)



releaseSavepoint
public void releaseSavepoint(long transactionId, String name) throws SQLException(Code)
Releases a savepoint given its name from a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  name - the name of the savepoint
exception:
  SQLException - if an error occurs



removeCheckpoint
public void removeCheckpoint(String checkpointName)(Code)
Remove a checkpoint and corresponding entries from the log table
Parameters:
  checkpointName - to remove



removeSavepoint
public void removeSavepoint(Long tid, String savepointName)(Code)
Removes a given savepoint for a given transaction
Parameters:
  tid - transaction id
Parameters:
  savepointName - name of the savepoint



removeSavepoints
public void removeSavepoints(Long tid, String savepointName)(Code)
Removes all the savepoints set after a given savepoint for a given transaction
Parameters:
  tid - transaction id
Parameters:
  savepointName - name of the savepoint



restoreBackendFromBackupCheckpoint
public void restoreBackendFromBackupCheckpoint(DatabaseBackend backend, String login, String password, String dumpName, ArrayList tables) throws BackupException(Code)
Restore a dump on a specific backend. The proper Backuper is retrieved automatically according to the dump format stored in the recovery log dump table.

This method disables the backend and leave it disabled after recovery process. The user has to call the enableBackendFromCheckpoint after this.
Parameters:
  backend - the backend to restore
Parameters:
  login - the login to use to connect to the database for the restoreoperation
Parameters:
  password - the password to use to connect to the database for therestore operation
Parameters:
  dumpName - the name of the dump to restore
Parameters:
  tables - the list of tables to restore, null means all tables
throws:
  BackupException - if the restore operation failed




resumeActivity
public void resumeActivity()(Code)
Resume all transactions, writes and persistent connections.



rollback
public void rollback(long transactionId, boolean logRollback) throws SQLException(Code)
Rollback a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  logRollback - true if the rollback should be logged in the recoverylog
throws:
  SQLException - if an error occurs



rollback
public void rollback(long transactionId, String savepointName) throws SQLException(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
throws:
  SQLException - if an error occurs



scheduleExecWriteRequest
public void scheduleExecWriteRequest(AbstractWriteRequest request) throws SQLException(Code)
Schedule a request for execution.
Parameters:
  request - the request to execute
throws:
  SQLException - if an error occurs



scheduleStoredProcedure
public void scheduleStoredProcedure(StoredProcedure proc) throws SQLException(Code)
This method does some sanity check on the given stored procedure and then tries to schedule it. Note that it is more likely that on a stored procedure the scheduler will lock in write the entire database as it does not know which tables are accessed by the procedure.
Parameters:
  proc - the stored procedure to schedule
throws:
  SQLException - if an error occurs



setBackupManager
public void setBackupManager(BackupManager currentBackupManager)(Code)
Sets the backup manager for this recovery log
Parameters:
  currentBackupManager - an instance of BackupManager



setCacheParsingranularity
public void setCacheParsingranularity(int cacheParsingranularity)(Code)
Sets the cacheParsingranularity value.
Parameters:
  cacheParsingranularity - The cacheParsingranularity to set.



setCaseSensitiveParsing
public void setCaseSensitiveParsing(boolean isCaseSensitiveParsing)(Code)
Sets the parsing case sensitivity. If true the request are parsed in a case sensitive way (table/column name must match exactly the case of the names fetched from the database or enforced by a static schema).
Parameters:
  isCaseSensitiveParsing - true if parsing is case sensitive



setDatabaseSchema
public synchronized void setDatabaseSchema(DatabaseSchema schema, boolean isStatic)(Code)
Sets the DatabaseSchema to be able to parse the requests and find dependencies.
Parameters:
  schema - a DatabaseSchema value
Parameters:
  isStatic - true if the given schema is static



setLoadBalancer
public void setLoadBalancer(AbstractLoadBalancer loadBalancer)(Code)
Set the Request Load Balancer to use in this Request Controller.
Parameters:
  loadBalancer - a Request Load Balancer implementation



setMetadataCache
public void setMetadataCache(MetadataCache metadataCache)(Code)
Sets the metadataCache value.
Parameters:
  metadataCache - The metadataCache to set.



setParsingCache
public void setParsingCache(ParsingCache parsingCache)(Code)
Sets the ParsingCache.
Parameters:
  parsingCache - The parsingCache to set.



setRecoveryLog
public void setRecoveryLog(RecoveryLog recoveryLog)(Code)
Sets the Recovery Log Manager.
Parameters:
  recoveryLog - The log recovery to set



setResultCache
public void setResultCache(AbstractResultCache cache)(Code)
Set the Request Cache to use in this Request Controller.
Parameters:
  cache - a Request Cache implementation



setSavepoint
public int setSavepoint(long transactionId) throws SQLException(Code)
Sets a unnamed savepoint to a transaction given its id.
Parameters:
  transactionId - the transaction id the generated id of the new savepoint
throws:
  SQLException - if an error occurs



setSavepoint
public void setSavepoint(long transactionId, String name) throws SQLException(Code)
Sets a savepoint given its desired name to a transaction given its id.
Parameters:
  transactionId - the transaction id
Parameters:
  name - the desired name of the savepoint
throws:
  SQLException - if an error occurs



setScheduler
public void setScheduler(AbstractScheduler scheduler)(Code)
Set the Request Scheduler to use in this Request Controller.
Parameters:
  scheduler - a Request Scheduler implementation



setSchedulerParsingranularity
public void setSchedulerParsingranularity(int schedulerParsingranularity)(Code)
Sets the schedulerParsingranularity value.
Parameters:
  schedulerParsingranularity - The schedulerParsingranularity to set.



setSchemaIsDirty
public synchronized void setSchemaIsDirty(boolean schemaIsDirty)(Code)
Sets the schemaIsDirty value if the backend schema needs to be refreshed.
Parameters:
  schemaIsDirty - The schemaIsDirty to set.



setStaticSchema
public void setStaticSchema(boolean schemaIsStatic)(Code)
Sets the schemaIsStatic value.
Parameters:
  schemaIsStatic - The schemaIsStatic to set.



statementExecute
public ExecuteResult statementExecute(AbstractRequest request) throws AllBackendsFailedException, SQLException(Code)
Execute a call to CallableStatement.execute() and returns a suite of updateCount and/or ResultSets.
Parameters:
  request - the stored procedure to execute an ExecuteResult object
throws:
  AllBackendsFailedException - if all backends failed to execute thestored procedure
exception:
  SQLException - if an error occurs



statementExecuteQuery
public ControllerResultSet statementExecuteQuery(SelectRequest request) throws SQLException(Code)
Perform a read request and return the reply. Call first the scheduler, then the cache (if defined) and finally the load balancer.
Parameters:
  request - the request to execute a ControllerResultSet value
exception:
  SQLException - if an error occurs



statementExecuteUpdate
public ExecuteUpdateResult statementExecuteUpdate(AbstractWriteRequest request) throws SQLException(Code)
Perform a write request and return the number of rows affected Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
Parameters:
  request - the request to execute number of rows affected
exception:
  SQLException - if an error occurs



statementExecuteUpdateWithKeys
public GeneratedKeysResult statementExecuteUpdateWithKeys(AbstractWriteRequest request) throws SQLException(Code)
Perform a write request and return the auto generated keys. Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
Parameters:
  request - the request to execute auto generated keys.
exception:
  SQLException - if an error occurs



storeBackendsInfo
public void storeBackendsInfo(String databaseName, ArrayList backends)(Code)
Store all the backends checkpoint in the recoverylog
Parameters:
  databaseName - the virtual database name
Parameters:
  backends - the Arraylist of backends



suspendActivity
public void suspendActivity() throws SQLException(Code)
Suspend all transactions, writes and persistent connections.
throws:
  SQLException - if an error occured while waiting for writes ortransactions to complete



updateAndNotifyExecWriteRequest
public void updateAndNotifyExecWriteRequest(AbstractWriteRequest request, int updateCount) throws SQLException(Code)
Update the recovery log, cache, update the database schema if needed and finally notify the scheduler. Note that if an error occurs, the scheduler is always notified.
Parameters:
  request - the request to execute
Parameters:
  updateCount - the update count if query was executed withexecuteUpdate(), -1 otherwise
throws:
  SQLException - if an error occurs



updateRecoveryLogFlushCacheAndRefreshSchema
public void updateRecoveryLogFlushCacheAndRefreshSchema(StoredProcedure proc) throws SQLException(Code)
Update the recovery log with successful completion of the query, flush the cache and force schema refresh if needed.
Parameters:
  proc - the stored procedure to log
throws:
  SQLException - if the transaction context could not be updated



Methods inherited from org.continuent.sequoia.controller.jmx.AbstractStandardMBean
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)(Code)(Java Doc)
abstract public String getAssociatedString()(Code)(Java Doc)
public NotificationBroadcasterSupport getBroadcaster()(Code)(Java Doc)
protected String getDescription(MBeanInfo info)(Code)(Java Doc)
protected String getDescription(MBeanConstructorInfo ctor)(Code)(Java Doc)
protected String getDescription(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)(Code)(Java Doc)
protected String getDescription(MBeanAttributeInfo info)(Code)(Java Doc)
protected String getDescription(MBeanOperationInfo info)(Code)(Java Doc)
protected String getDescription(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
protected String getParameterName(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)(Code)(Java Doc)
protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)(Code)(Java Doc)
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)(Java Doc)
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)(Java Doc)
public void sendNotification(Notification notification)(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.