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 () |
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.
Definition at line 57 of file RAIDb1_WRR.java.
|
Creates a new RAIDb-1 Weighted Round Robin request load balancer.
Definition at line 82 of file RAIDb1_WRR.java. 00084 { 00085 super(vdb, waitForCompletionPolicy); 00086 index = -1; 00087 }
|
|
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.
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 }
|
|
Selects the backend using a weighted round-robin algorithm and executes the read request.
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 }
|
|
Gets information about the request load balancer.
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 }
|
|
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 }
|
|
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 }
|