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

org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR Class Reference

Inheritance diagram for org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RAIDb1_WRR (VirtualDatabase vdb, WaitForCompletionPolicy waitForCompletionPolicy) 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 getRaidb1Xml ()

Detailed Description

RAIDb-1 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

Nicolas Modrzyk

Version:
1.0

Definition at line 57 of file RAIDb1_WRR.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.RAIDb1_WRR VirtualDatabase  vdb,
WaitForCompletionPolicy  waitForCompletionPolicy
throws Exception
 

Creates a new RAIDb-1 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?
Exceptions:
Exception if an error occurs

Definition at line 82 of file RAIDb1_WRR.java.

00084   {
00085     super(vdb, waitForCompletionPolicy);
00086     index = -1;
00087   }


Member Function Documentation

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

Selects the backend using a least pending request first policy. The backend that has the shortest queue of currently executing queries is chosen to execute this stored procedure.

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

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

Definition at line 114 of file RAIDb1_WRR.java.

00116   {
00117     return executeWRR(proc, false, "Stored procedure ", metadataCache);
00118   }

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

Selects the backend using a weighted round-robin algorithm and executes the read request.

See also:
org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1.execReadRequest(SelectRequest, MetadataCache)

Implements org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1.

Definition at line 100 of file RAIDb1_WRR.java.

00102   {
00103     return executeWRR(request, true, "Request ", metadataCache);
00104   }

String org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.getInformation  )  [virtual]
 

Gets information about the request load balancer.

Returns:
String containing information

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

Definition at line 277 of file RAIDb1_WRR.java.

00278   {
00279     // We don't lock since we don't need a top accurate value
00280     int size = vdb.getBackends().size();
00281 
00282     if (size == 0)
00283       return "RAIDb-1 with Weighted Round Robin Request load balancer: !!!Warning!!! No backend nodes found\n";
00284     else
00285       return "RAIDb-1 Weighted Round-Robin Request load balancer (" + size
00286           + " backends)\n";
00287   }

String org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.getRaidb1Xml  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1.getRaidb1Xml

Implements org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1.

Definition at line 292 of file RAIDb1_WRR.java.

00293   {
00294     return WeightedBalancer.getRaidbXml(weights,
00295         DatabasesXmlTags.ELT_RAIDb_1_WeightedRoundRobin);
00296   }

void org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_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 259 of file RAIDb1_WRR.java.

References org.objectweb.cjdbc.common.log.Trace.debug().

00260   {
00261     if (logger.isDebugEnabled())
00262       logger.debug(Translate.get("loadbalancer.weight.set", new String[]{
00263           String.valueOf(w), name}));
00264 
00265     weights.put(name, new Integer(w));
00266   }


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