Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR Class Reference

Inheritance diagram for org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RAIDb2_WRR (VirtualDatabase vdb, WaitForCompletionPolicy waitForCompletionPolicy, CreateTablePolicy createTablePolicy) throws Exception
ControllerResultSet execReadRequest (SelectRequest request, MetadataCache metadataCache) throws SQLException
ControllerResultSet execReadOnlyReadStoredProcedure (StoredProcedure proc, MetadataCache metadataCache) throws SQLException
void setWeight (String name, int w) throws SQLException
String getInformation ()
String getRaidb2Xml ()

Detailed Description

RAIDb-2 Weighted Round Robin load balancer.

The read requests coming from the request manager are sent to the backend nodes using a weighted round robin. Write requests are broadcasted to all backends.

Author:
Emmanuel Cecchet

Julie Marguerite

Version:
1.0

Definition at line 52 of file RAIDb2_WRR.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.RAIDb2_WRR VirtualDatabase  vdb,
WaitForCompletionPolicy  waitForCompletionPolicy,
CreateTablePolicy  createTablePolicy
throws Exception
 

Creates a new RAIDb-2 Weighted Round Robin request load balancer.

Parameters:
vdb The virtual database this load balancer belongs to.
waitForCompletionPolicy How many backends must complete before returning the result?
createTablePolicy The policy defining how 'create table' statements should be handled
Exceptions:
Exception if an error occurs

Definition at line 75 of file RAIDb2_WRR.java.

00078   {
00079     super(vdb, waitForCompletionPolicy, createTablePolicy);
00080   }


Member Function Documentation

ControllerResultSet org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.execReadOnlyReadStoredProcedure StoredProcedure  proc,
MetadataCache  metadataCache
throws SQLException [virtual]
 

Chooses the node to execute the stored procedure using a round-robin algorithm. If the next node has not the needed stored procedure, we try the next one and so on until a suitable backend is found.

See also:
org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.execReadOnlyReadStoredProcedure(StoredProcedure, MetadataCache)

Implements org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.

Definition at line 112 of file RAIDb2_WRR.java.

00114   {
00115     throw new NotImplementedException(this.getClass().getName()
00116         + ":execReadStoredProcedure");
00117   }

ControllerResultSet org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.execReadRequest SelectRequest  request,
MetadataCache  metadataCache
throws SQLException [virtual]
 

Performs a read request. It is up to the implementation to choose to which backend node(s) this request should be sent.

Parameters:
request an SelectRequest
metadataCache cached metadata to use to construct the result set
Returns:
the corresponding java.sql.ResultSet
Exceptions:
SQLException if an error occurs
See also:
org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.execReadRequest(SelectRequest, MetadataCache)

Implements org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.

Definition at line 97 of file RAIDb2_WRR.java.

00099   {
00100     throw new NotImplementedException(this.getClass().getName()
00101         + ":execReadRequest");
00102   }

String org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.getInformation  )  [virtual]
 

Gets information about the request load balancer.

Returns:
String containing information

Implements org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.

Definition at line 141 of file RAIDb2_WRR.java.

00142   {
00143     if (weights == null)
00144       return "RAIDb-2 Weighted Round Robin Request load balancer: !!!Warning!!! No backend nodes found\n";
00145     else
00146       return "RAIDb-2 Weighted Round Robin Request load balancer balancing over "
00147           + weights.size() + " nodes\n";
00148   }

String org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.getRaidb2Xml  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.getRaidb2Xml

Implements org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.

Definition at line 153 of file RAIDb2_WRR.java.

00154   {
00155     return WeightedBalancer.getRaidbXml(weights,
00156         DatabasesXmlTags.ELT_RAIDb_2_WeightedRoundRobin);
00157   }

void org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_WRR.setWeight String  name,
int  w
throws SQLException
 

See also:
org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.setWeight(String, int)

Reimplemented from org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.

Definition at line 127 of file RAIDb2_WRR.java.

00128   {
00129     throw new SQLException("Weight is not supported with this load balancer");
00130   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:04:11 2005 for C-JDBC by  doxygen 1.3.9.1