|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0
RAIDb-0: database partitioning.
The requests are sent to the backend nodes hosting the tables needed to execute the request. If no backend has the needed tables to perform a request, it will fail.
| Field Summary | |
private java.util.ArrayList |
backendThreads
|
private ReadPrioritaryFIFOWriteLock |
backendThreadsRWLock
|
private CreateTablePolicy |
createTablePolicy
|
protected static Trace |
logger
|
| Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
parsingGranularity, raidbLevel, vdb |
| Constructor Summary | |
RAIDb0(VirtualDatabase vdb,
CreateTablePolicy createTablePolicy)
Creates a new RAIDb-0 request load balancer. |
|
| Method Summary | |
void |
begin(TransactionMarkerMetaData tm)
Begins a new transaction. |
void |
commit(TransactionMarkerMetaData tm)
Commits a transaction. |
void |
disableBackend(DatabaseBackend db)
Disables a backend that was previously enabled. |
void |
enableBackend(DatabaseBackend db)
Enables a Backend that was previously disabled. |
java.sql.ResultSet |
execReadRequest(SelectRequest request)
Performs a read request on the backend that has the needed tables to executes the request. |
java.sql.ResultSet |
execReadStoredProcedure(StoredProcedure proc)
Call a stored procedure that returns a ResultSet. |
int |
execWriteRequest(AbstractWriteRequest request)
Performs a write request on the backend that has the needed tables to executes the request. |
java.sql.ResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request)
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. |
java.lang.String |
getInformation()
Get information about the Request load balancer |
java.lang.String |
getXmlInformation()
Get information about the Request Load Balancer in xml |
void |
rollback(TransactionMarkerMetaData tm)
Rollbacks a transaction. |
void |
setWeight(java.lang.String name,
int w)
Associate a weight to a backend identified by its logical name. |
private void |
updateSchema(DatabaseBackend b,
AbstractWriteRequest request)
Update the backend schema if needed |
| Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
getParsingGranularity, getRAIDbLevel, setParsingGranularity, setRAIDbLevel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.ArrayList backendThreads
private ReadPrioritaryFIFOWriteLock backendThreadsRWLock
private CreateTablePolicy createTablePolicy
protected static Trace logger
| Constructor Detail |
public RAIDb0(VirtualDatabase vdb,
CreateTablePolicy createTablePolicy)
throws java.sql.SQLException
vdb - the virtual database this load balancer belongs to.createTablePolicy - the policy defining how 'create table' statements
should be handled
java.sql.SQLException - if an error occurs| Method Detail |
public java.sql.ResultSet execReadRequest(SelectRequest request)
throws java.sql.SQLException
execReadRequest in class AbstractLoadBalancerrequest - an SelectRequest
java.sql.ResultSet
java.sql.SQLException - if an error occurs
public int execWriteRequest(AbstractWriteRequest request)
throws java.sql.SQLException
execWriteRequest in class AbstractLoadBalancerrequest - an AbstractWriteRequest
java.sql.SQLException - if an error occurs
private final void updateSchema(DatabaseBackend b,
AbstractWriteRequest request)
public java.sql.ResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
throws java.sql.SQLException
AbstractLoadBalancer
execWriteRequestWithKeys in class AbstractLoadBalancerrequest - an AbstractWriteRequest
java.sql.SQLException - if an error occursAbstractLoadBalancer.execWriteRequestWithKeys(AbstractWriteRequest)
public java.sql.ResultSet execReadStoredProcedure(StoredProcedure proc)
throws java.sql.SQLException
AbstractLoadBalancer
execReadStoredProcedure in class AbstractLoadBalancerproc - the stored procedure call
java.sql.ResultSet value
java.sql.SQLException - if an error occursAbstractLoadBalancer.execReadStoredProcedure(org.objectweb.cjdbc.sql.StoredProcedure)
public int execWriteStoredProcedure(StoredProcedure proc)
throws java.sql.SQLException
AbstractLoadBalancer
execWriteStoredProcedure in class AbstractLoadBalancerproc - the stored procedure call
java.sql.SQLException - if an error occursAbstractLoadBalancer.execWriteStoredProcedure(org.objectweb.cjdbc.sql.StoredProcedure)
public final void begin(TransactionMarkerMetaData tm)
throws java.sql.SQLException
begin in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void commit(TransactionMarkerMetaData tm)
throws java.sql.SQLException
commit in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void rollback(TransactionMarkerMetaData tm)
throws java.sql.SQLException
rollback in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void enableBackend(DatabaseBackend db)
throws java.sql.SQLException
Ask the corresponding connection manager to initialize the connections if needed.
No sanity checks are performed by this function.
enableBackend in class AbstractLoadBalancerdb - the database backend to enable
java.sql.SQLException - if an error occurs
public void disableBackend(DatabaseBackend db)
throws java.sql.SQLException
Ask the corresponding connection manager to finalize the connections if needed.
No sanity checks are performed by this function.
disableBackend in class AbstractLoadBalancerdb - the database backend to disable
java.sql.SQLException - if an error occurs
public void setWeight(java.lang.String name,
int w)
throws java.sql.SQLException
AbstractLoadBalancer
setWeight in class AbstractLoadBalancername - the backend namew - the weight
java.sql.SQLException - if an error occursAbstractLoadBalancer.setWeight(String, int)public java.lang.String getInformation()
getInformation in class AbstractLoadBalancerString containing informationpublic java.lang.String getXmlInformation()
AbstractLoadBalancer
getXmlInformation in class AbstractLoadBalancerString containing information, xml formattedAbstractLoadBalancer.getXmlInformation()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||