|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.StandardMBean org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB
These are generic functions for all ParallelDB load balancers.
Read and write queries are load balanced on the backends without any replication (assuming that the underlying parallel database takes care of data replication). The load balancers provide failover for reads and writes.
Nested Class Summary |
Nested classes inherited from class javax.management.StandardMBean |
|
Field Summary | |
private java.util.Hashtable |
backendPerTransactionId
|
private int |
numberOfEnabledBackends
|
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
logger, macroHandler, parsingGranularity, raidbLevel, totalOrderQueue, 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_CONTROLLER, DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
ParallelDB(VirtualDatabase vdb)
Creates a new ParallelDB load balancer with NO_PARSING and a
SingleDB RAIDb level. |
Method Summary | |
void |
begin(TransactionMarkerMetaData tm)
Begin a new transaction. |
abstract DatabaseBackend |
chooseBackendForReadRequest(AbstractRequest request)
Choose a backend using the implementation specific load balancing algorithm for read request execution. |
abstract DatabaseBackend |
chooseBackendForWriteRequest(AbstractWriteRequest request)
Choose a backend using the implementation specific load balancing algorithm for write request execution. |
void |
commit(TransactionMarkerMetaData tm)
Commit a transaction. |
void |
disableBackend(DatabaseBackend db)
Disables a backend that was previously enabled. |
void |
enableBackend(DatabaseBackend db,
boolean writeEnabled)
Enables a backend that was previously disabled. |
ControllerResultSet |
execReadOnlyReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
Call a read-only stored procedure that returns a ResultSet. |
ControllerResultSet |
execReadRequest(SelectRequest request,
MetadataCache metadataCache)
Perform a read request. |
ControllerResultSet |
execReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
Call a stored procedure that returns a ResultSet. |
private ControllerResultSet |
executeReadRequestOnBackend(SelectRequest request,
DatabaseBackend backend,
MetadataCache metadataCache)
Execute a read request on the selected backend. |
private ControllerResultSet |
executeReadStoredProcedureOnBackend(StoredProcedure proc,
DatabaseBackend backend,
MetadataCache metadataCache)
Execute a stored procedure on the selected backend. |
private int |
executeWriteRequestOnBackend(AbstractWriteRequest request,
DatabaseBackend backend)
Execute a write request on the selected backend. |
private ControllerResultSet |
executeWriteRequestWithKeysOnBackend(AbstractWriteRequest request,
DatabaseBackend backend,
MetadataCache metadataCache)
Execute a write request on the selected backend and return the autogenerated keys. |
private int |
executeWriteStoredProcedureOnBackend(StoredProcedure proc,
DatabaseBackend backend)
Execute a stored procedure on the selected backend. |
int |
execWriteRequest(AbstractWriteRequest request)
Perform a write request. |
ControllerResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request,
MetadataCache metadataCache)
Perform a write request and return a ResultSet containing the auto generated keys. |
int |
execWriteStoredProcedure(StoredProcedure proc)
Call a stored procedure that performs an update. |
int |
getNumberOfEnabledBackends()
Get the number of currently enabled backends. 0 means that no backend is available. |
abstract java.lang.String |
getParallelDBXml()
Return the XML tags of the ParallelDB load balancer implementation. |
java.lang.String |
getXmlImpl()
Get information about the Request Load Balancer in xml |
void |
releaseSavepoint(TransactionMarkerMetaData tm,
java.lang.String name)
Release a savepoint from a transaction |
void |
rollback(TransactionMarkerMetaData tm)
Rollback a transaction. |
void |
rollback(TransactionMarkerMetaData tm,
java.lang.String savepointName)
Rollback a transaction to a savepoint |
void |
setSavepoint(TransactionMarkerMetaData tm,
java.lang.String name)
Set a savepoint to a transaction. |
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
executeReadStoredProcedureOnBackend, executeSelectRequestOnBackend, executeUpdateRequestOnBackend, executeUpdateRequestOnBackendWithKeys, executeWriteStoredProcedureOnBackend, getAssociatedString, getConnectionAndBeginTransaction, getInformation, getParsingGranularity, getRAIDbLevel, getXml, handleMacros, removeHeadFromAndNotifyTotalOrderQueue, setMacroHandler, setParsingGranularity, setRAIDbLevel, setWeight, waitForTotalOrder |
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 |
private java.util.Hashtable backendPerTransactionId
private int numberOfEnabledBackends
Constructor Detail |
public ParallelDB(VirtualDatabase vdb) throws java.sql.SQLException, javax.management.NotCompliantMBeanException
ParallelDB
load balancer with NO_PARSING and a
SingleDB RAIDb level.
vdb
- the virtual database this load balancer belongs to.
java.sql.SQLException
- if an error occurs
javax.management.NotCompliantMBeanException
- if the MBean is not JMX compliantMethod Detail |
public abstract DatabaseBackend chooseBackendForReadRequest(AbstractRequest request) throws java.sql.SQLException
request
- request to execute
java.sql.SQLException
- if an error occurspublic abstract DatabaseBackend chooseBackendForWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
request
- request to execute
java.sql.SQLException
- if an error occurspublic ControllerResultSet execReadRequest(SelectRequest request, MetadataCache metadataCache) throws java.sql.SQLException
AbstractLoadBalancer
execReadRequest
in class AbstractLoadBalancer
request
- an SelectRequest
metadataCache
- MetadataCache (null if none)
ControllerResultSet
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execReadRequest(SelectRequest,
MetadataCache)
public ControllerResultSet execReadOnlyReadStoredProcedure(StoredProcedure proc, MetadataCache metadataCache) throws java.sql.SQLException
AbstractLoadBalancer
execReadOnlyReadStoredProcedure
in class AbstractLoadBalancer
proc
- the stored procedure callmetadataCache
- MetadataCache (null if none)
ControllerResultSet
value
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execReadOnlyReadStoredProcedure(StoredProcedure,
MetadataCache)
public ControllerResultSet execReadStoredProcedure(StoredProcedure proc, MetadataCache metadataCache) throws java.sql.SQLException
AbstractLoadBalancer
execReadStoredProcedure
in class AbstractLoadBalancer
proc
- the stored procedure callmetadataCache
- MetadataCache (null if none)
ControllerResultSet
value
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execReadStoredProcedure(StoredProcedure,
MetadataCache)
public int execWriteRequest(AbstractWriteRequest request) throws AllBackendsFailedException, java.sql.SQLException
AbstractLoadBalancer
execWriteRequest
in class AbstractLoadBalancer
request
- an AbstractWriteRequest
AllBackendsFailedException
- if all backends failed to execute the
request
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)
public ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request, MetadataCache metadataCache) throws AllBackendsFailedException, java.sql.SQLException
AbstractLoadBalancer
execWriteRequestWithKeys
in class AbstractLoadBalancer
request
- an AbstractWriteRequest
metadataCache
- MetadataCache (null if none)
AllBackendsFailedException
- if all backends failed to execute the
request
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execWriteRequestWithKeys(AbstractWriteRequest,
MetadataCache)
public int execWriteStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
AbstractLoadBalancer
execWriteStoredProcedure
in class AbstractLoadBalancer
proc
- the stored procedure call
java.sql.SQLException
- if an error occursAbstractLoadBalancer.execWriteStoredProcedure(org.objectweb.cjdbc.common.sql.StoredProcedure)
private ControllerResultSet executeReadRequestOnBackend(SelectRequest request, DatabaseBackend backend, MetadataCache metadataCache) throws java.sql.SQLException, UnreachableBackendException
request
- the request to executebackend
- the backend that will execute the requestmetadataCache
- MetadataCache (null if none)
java.sql.SQLException
- if an error occurs
UnreachableBackendException
private ControllerResultSet executeReadStoredProcedureOnBackend(StoredProcedure proc, DatabaseBackend backend, MetadataCache metadataCache) throws java.sql.SQLException, UnreachableBackendException
proc
- the stored procedure to executebackend
- the backend that will execute the requestmetadataCache
- MetadataCache (null if none)
java.sql.SQLException
- if an error occurs
UnreachableBackendException
private int executeWriteRequestOnBackend(AbstractWriteRequest request, DatabaseBackend backend) throws java.sql.SQLException, UnreachableBackendException
request
- the request to executebackend
- the backend that will execute the request
java.sql.SQLException
- if an error occurs
UnreachableBackendException
private ControllerResultSet executeWriteRequestWithKeysOnBackend(AbstractWriteRequest request, DatabaseBackend backend, MetadataCache metadataCache) throws java.sql.SQLException, UnreachableBackendException
request
- the request to executebackend
- the backend that will execute the requestmetadataCache
- MetadataCache (null if none)
java.sql.SQLException
- if an error occurs
UnreachableBackendException
private int executeWriteStoredProcedureOnBackend(StoredProcedure proc, DatabaseBackend backend) throws java.sql.SQLException, UnreachableBackendException
proc
- the stored procedure to executebackend
- the backend that will execute the request
java.sql.SQLException
- if an error occurs
UnreachableBackendException
public void begin(TransactionMarkerMetaData tm) throws java.sql.SQLException
AbstractLoadBalancer
begin
in class AbstractLoadBalancer
tm
- The transaction marker metadata
java.sql.SQLException
- if an error occursAbstractLoadBalancer.begin(org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData)
public void commit(TransactionMarkerMetaData tm) throws java.sql.SQLException
AbstractLoadBalancer
commit
in class AbstractLoadBalancer
tm
- The transaction marker metadata
java.sql.SQLException
- if an error occursAbstractLoadBalancer.commit(org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData)
public void rollback(TransactionMarkerMetaData tm) throws java.sql.SQLException
AbstractLoadBalancer
rollback
in class AbstractLoadBalancer
tm
- The transaction marker metadata
java.sql.SQLException
- if an error occursAbstractLoadBalancer.rollback(org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData)
public void rollback(TransactionMarkerMetaData tm, java.lang.String savepointName) throws java.sql.SQLException
rollback
in class AbstractLoadBalancer
tm
- The transaction marker metadatasavepointName
- The name of the savepoint
java.sql.SQLException
- if an error occurspublic void releaseSavepoint(TransactionMarkerMetaData tm, java.lang.String name) throws java.sql.SQLException
releaseSavepoint
in class AbstractLoadBalancer
tm
- The transaction marker metadataname
- The name of the savepoint ro release
java.sql.SQLException
- if an error occurspublic void setSavepoint(TransactionMarkerMetaData tm, java.lang.String name) throws java.sql.SQLException
setSavepoint
in class AbstractLoadBalancer
tm
- The transaction marker metadataname
- The name of the new savepoint
java.sql.SQLException
- if an error occurspublic void enableBackend(DatabaseBackend db, boolean writeEnabled) throws java.sql.SQLException
No sanity checks are performed by this function.
enableBackend
in class AbstractLoadBalancer
db
- the database backend to enablewriteEnabled
- True if the backend must be enabled for writes
java.sql.SQLException
- if an error occurspublic void disableBackend(DatabaseBackend db) throws java.sql.SQLException
No sanity checks are performed by this function.
disableBackend
in class AbstractLoadBalancer
db
- the database backend to disable
java.sql.SQLException
- if an error occurspublic int getNumberOfEnabledBackends()
AbstractLoadBalancer
getNumberOfEnabledBackends
in class AbstractLoadBalancer
AbstractLoadBalancer.getNumberOfEnabledBackends()
public java.lang.String getXmlImpl()
AbstractLoadBalancer
getXmlImpl
in class AbstractLoadBalancer
String
containing information, xml formattedAbstractLoadBalancer.getXmlImpl()
public abstract java.lang.String getParallelDBXml()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |