|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.StandardMBean
org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
org.objectweb.cjdbc.controller.requestmanager.RequestManager
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager
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-dsitributed Request Manager, this implementation is responsible for synchronizing the different controllers components (schedulers, ...). Functions that are RAIDb level dependent are implemented in sub-classes.
Nested Class Summary |
Nested classes inherited from class javax.management.StandardMBean |
|
Field Summary | |
private long |
controllerId
Unique controller identifier |
protected DistributedVirtualDatabase |
dvdb
|
private java.util.Vector |
failedOnAllBackends
List of queries that failed on all backends |
private java.util.ArrayList |
writeTransactions
List of transactions that have executed at least one write query |
Fields inherited from class org.objectweb.cjdbc.controller.requestmanager.RequestManager |
backupManager, beginTimeout, commitTimeout, dbs, loadBalancer, logger, parsingCache, recoveryLog, requiredGranularity, resultCache, rollbackTimeout, scheduler, schedulerParsingranularity, tidLoginTable, vdb |
Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
|
Fields inherited from class javax.management.StandardMBean |
|
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
DistributedRequestManager(DistributedVirtualDatabase vdb,
AbstractScheduler scheduler,
AbstractResultCache cache,
AbstractLoadBalancer loadBalancer,
AbstractRecoveryLog recoveryLog,
long beginTimeout,
long commitTimeout,
long rollbackTimeout)
Builds a new DistributedRequestManager instance without
cache. |
Method Summary | |
void |
addFailedOnAllBackends(AbstractRequest request)
Add a request that failed on all backends. |
long |
begin(java.lang.String login)
Begin a new transaction and return the corresponding transaction identifier. |
void |
commit(long transactionId)
Commit a transaction given its id. |
void |
completeFailedOnAllBackends(AbstractRequest request,
boolean success)
Notify completion of a request that failed on all backends. |
abstract void |
distributedCommit(long transactionId)
Distributed implementation of a commit |
abstract void |
distributedRollback(long transactionId)
Distributed implementation of a rollback |
void |
enableBackend(DatabaseBackend db)
Enable a backend that has been previously added to this virtual database and that is in the disabled state. |
abstract ControllerResultSet |
execDistributedReadStoredProcedure(StoredProcedure proc)
Distributed implementation of a read stored procedure execution. |
ControllerResultSet |
execDistributedReadStoredProcedureLocally(StoredProcedure proc)
Once the request has been dispatched, it can be executed using the code from RequestManager |
abstract int |
execDistributedWriteRequest(AbstractWriteRequest request)
Distributed implementation of a write request execution. |
abstract ControllerResultSet |
execDistributedWriteRequestWithKeys(AbstractWriteRequest request)
Distributed implementation of a write request execution that returns auto-generated keys. |
abstract int |
execDistributedWriteStoredProcedure(StoredProcedure proc)
Distributed implementation of a write stored procedure execution. |
int |
execDistributedWriteStoredProcedureLocally(StoredProcedure proc)
Once the request has been dispatched, it can be executed using the code from RequestManager |
ControllerResultSet |
execReadStoredProcedure(StoredProcedure proc)
Call a stored procedure that returns a ResultSet. |
int |
execWriteRequest(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. |
ControllerResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request)
Perform a write request and return the auto generated keys. |
int |
execWriteStoredProcedure(StoredProcedure proc)
Call a stored procedure that performs an update. |
Trace |
getLogger()
Get the trace logger of this DistributedRequestManager |
VirtualDatabase |
getVirtualDatabase()
Returns the vdb value. |
void |
lazyTransactionStart(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. |
void |
rollback(long transactionId)
Rollback a transaction given its id. |
void |
scheduleExecWriteRequest(AbstractWriteRequest request)
Schedule a request for execution. |
void |
setControllerId(int id)
Sets the controller identifier value (this id must be unique). |
Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class javax.management.StandardMBean |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DistributedVirtualDatabase dvdb
private java.util.Vector failedOnAllBackends
private long controllerId
private java.util.ArrayList writeTransactions
Constructor Detail |
public DistributedRequestManager(DistributedVirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, AbstractRecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout) throws java.sql.SQLException, javax.management.NotCompliantMBeanException
DistributedRequestManager
instance without
cache.
vdb
- the virtual database this request manager belongs toscheduler
- the Request Scheduler to usecache
- a Query Cache implementationloadBalancer
- the Request Load Balancer to userecoveryLog
- the Log Recovery to usebeginTimeout
- timeout in seconds for begincommitTimeout
- timeout in seconds for commitrollbackTimeout
- timeout in seconds for rollback
java.sql.SQLException
- if an error occurs
javax.management.NotCompliantMBeanException
- if this class is not a compliant JMX
MBeanMethod Detail |
public Trace getLogger()
Trace
objectpublic VirtualDatabase getVirtualDatabase()
getVirtualDatabase
in class RequestManager
public void enableBackend(DatabaseBackend db) throws java.sql.SQLException
enableBackend
in class RequestManager
db
- The database backend to enable
java.sql.SQLException
- if an error occurspublic void addFailedOnAllBackends(AbstractRequest request)
request
- the request that failedpublic void completeFailedOnAllBackends(AbstractRequest request, boolean success)
request
- request that completedsuccess
- true if completion is successfulpublic void setControllerId(int id)
id
- The controllerId to set.public long begin(java.lang.String login) throws java.sql.SQLException
RequestManager
begin
in class RequestManager
login
- the login used by the connection
java.sql.SQLException
- if an error occursRequestManager.begin(java.lang.String)
public void commit(long transactionId) throws java.sql.SQLException
RequestManager
commit
in class RequestManager
transactionId
- the transaction id
java.sql.SQLException
- if an error occursRequestManager.commit(long)
public void rollback(long transactionId) throws java.sql.SQLException
RequestManager
rollback
in class RequestManager
transactionId
- the transaction id
java.sql.SQLException
- if an error occursRequestManager.rollback(long)
public void scheduleExecWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
RequestManager
scheduleExecWriteRequest
in class RequestManager
request
- the request to execute
java.sql.SQLException
- if an error occursRequestManager.scheduleExecWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)
public void lazyTransactionStart(AbstractRequest request) throws java.sql.SQLException
request
- query to execute
java.sql.SQLException
- if an error occurspublic int execWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
RequestManager
execWriteRequest
in class RequestManager
request
- the request to execute
java.sql.SQLException
- if an error occursRequestManager.execWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)
public ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request) throws java.sql.SQLException
RequestManager
execWriteRequestWithKeys
in class RequestManager
request
- the request to execute
java.sql.SQLException
- if an error occursRequestManager.execWriteRequestWithKeys(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)
public ControllerResultSet execReadStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
RequestManager
execReadStoredProcedure
in class RequestManager
proc
- the stored procedure call
ControllerResultSet
value
java.sql.SQLException
- if an error occursRequestManager.execReadStoredProcedure(StoredProcedure)
public int execWriteStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
RequestManager
execWriteStoredProcedure
in class RequestManager
proc
- the stored procedure call
java.sql.SQLException
- if an error occursRequestManager.execWriteStoredProcedure(org.objectweb.cjdbc.common.sql.StoredProcedure)
public abstract void distributedCommit(long transactionId) throws java.sql.SQLException
transactionId
- id of the commiting transaction
java.sql.SQLException
- if an error occurspublic abstract void distributedRollback(long transactionId) throws java.sql.SQLException
transactionId
- id of the rollbacking transaction
java.sql.SQLException
- if an error occurspublic abstract int execDistributedWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
request
- request to execute
java.sql.SQLException
- if an error occurspublic abstract ControllerResultSet execDistributedWriteRequestWithKeys(AbstractWriteRequest request) throws java.sql.SQLException
request
- request to execute
java.sql.SQLException
- if an error occurspublic abstract ControllerResultSet execDistributedReadStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
proc
- stored procedure to execute
java.sql.SQLException
- if an error occurspublic abstract int execDistributedWriteStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
proc
- stored procedure to execute
java.sql.SQLException
- if an error occurspublic ControllerResultSet execDistributedReadStoredProcedureLocally(StoredProcedure proc) throws java.sql.SQLException
RequestManager
proc
- stored procedure to execute
java.sql.SQLException
- if an error occurspublic int execDistributedWriteStoredProcedureLocally(StoredProcedure proc) throws java.sql.SQLException
RequestManager
proc
- stored procedure to execute
java.sql.SQLException
- if an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |