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

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

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

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RAIDb1_RR (VirtualDatabase vdb, WaitForCompletionPolicy waitForCompletionPolicy) throws Exception
ControllerResultSet execReadRequest (SelectRequest request, MetadataCache metadataCache) throws SQLException
ControllerResultSet execReadOnlyReadStoredProcedure (StoredProcedure proc, MetadataCache metadataCache) throws SQLException
String getInformation ()
String getRaidb1Xml ()

Detailed Description

RAIDb-1 Round Robin load balancer

The read requests coming from the Request Manager are sent in a round robin to the backend nodes. Write requests are broadcasted to all backends.

Author:
Emmanuel Cecchet

Julie Marguerite

Version:
1.0

Definition at line 53 of file RAIDb1_RR.java.


Constructor & Destructor Documentation

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

Creates a new RAIDb-1 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 74 of file RAIDb1_RR.java.

00076   {
00077     super(vdb, waitForCompletionPolicy);
00078     index = -1;
00079   }


Member Function Documentation

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

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

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

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

Definition at line 105 of file RAIDb1_RR.java.

00107   {
00108     return executeRoundRobinRequest(proc, false, "Stored procedure ",
00109         metadataCache);
00110   }

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

Selects the backend using a simple 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 92 of file RAIDb1_RR.java.

00094   {
00095     return executeRoundRobinRequest(request, true, "Request ", metadataCache);
00096   }

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

Gets information about the request load balancer.

Returns:
String containing information

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

Definition at line 239 of file RAIDb1_RR.java.

00240   {
00241     // We don't lock since we don't need a top accurate value
00242     int size = vdb.getBackends().size();
00243 
00244     if (size == 0)
00245       return "RAIDb-1 Round-Robin Request load balancer: !!!Warning!!! No backend nodes found\n";
00246     else
00247       return "RAIDb-1 Round-Robin Request load balancer (" + size
00248           + " backends)\n";
00249   }

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

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

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

Definition at line 254 of file RAIDb1_RR.java.

00255   {
00256     return "<" + DatabasesXmlTags.ELT_RAIDb_1_RoundRobin + "/>";
00257   }


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