org.objectweb.cjdbc.controller.loadbalancer.raidb2
Class RAIDb2_LPRF
java.lang.Object
org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2
org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF
- public class RAIDb2_LPRF
- extends RAIDb2
RAIDb-2 Round Robin load balancer featuring (Least Pending Requests First
load balancing algorithm).
The read requests coming from the request manager are sent to the node that
has the Least pending read requests among the nodes that can execute the
request.
- Version:
- 1.0
- Author:
- Emmanuel Cecchet
Method Summary |
java.sql.ResultSet |
execReadRequest(SelectRequest request)
Chooses the node to execute the request using a round-robin algorithm. |
java.lang.String |
getInformation()
Gets information about the request load balancer. |
java.lang.String |
getRaidb2Xml()
return xml formatted information about this raidb2 load balancer |
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2 |
begin, commit, disableBackend, enableBackend, execReadStoredProcedure, executeRequest, execWriteRequest, execWriteRequestWithKeys, execWriteStoredProcedure, getXmlCreateTable, getXmlInformation, getXmlWaitPolicy, rollback, waitForAllWritesToComplete, waitForAllWritesToComplete, waitForAllWritesToComplete |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RAIDb2_LPRF
public RAIDb2_LPRF(VirtualDatabase vdb,
WaitForCompletionPolicy waitForCompletionPolicy,
CreateTablePolicy createTablePolicy)
throws java.sql.SQLException
- Creates a new RAIDb-2 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
- Throws:
java.sql.SQLException
- if an error occurs
execReadRequest
public java.sql.ResultSet execReadRequest(SelectRequest request)
throws java.sql.SQLException
- Chooses the node to execute the request using a round-robin algorithm. If
the next node has not the tables needed to execute the requests, we try
the next one and so on until a suitable backend is found.
- Specified by:
execReadRequest
in class RAIDb2
- Parameters:
request
- an SelectRequest
- Returns:
- the corresponding
java.sql.ResultSet
- Throws:
java.sql.SQLException
- if an error occurs- See Also:
RAIDb2.executeRequest(SelectRequest, DatabaseBackend)
getInformation
public java.lang.String getInformation()
- Gets information about the request load balancer.
- Specified by:
getInformation
in class AbstractLoadBalancer
- Returns:
String
containing information
getRaidb2Xml
public java.lang.String getRaidb2Xml()
- Description copied from class:
RAIDb2
- return xml formatted information about this raidb2 load balancer
- Specified by:
getRaidb2Xml
in class RAIDb2
- Returns:
- xml formatted string
- See Also:
RAIDb2.getRaidb2Xml()
Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.