org.objectweb.cjdbc.controller.loadbalancer.paralleldb
Class ParallelDB_LPRF

java.lang.Object
  extended byjavax.management.StandardMBean
      extended byorg.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
          extended byorg.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
              extended byorg.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB
                  extended byorg.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF
All Implemented Interfaces:
AbstractLoadBalancerMBean, javax.management.DynamicMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, XmlComponent

public class ParallelDB_LPRF
extends ParallelDB

This class defines a ParallelDB_LPRF load balancer. This load balancer chooses the node that has the least pending queries for read and write queries execution.

Version:
1.0
Author:
Emmanuel Cecchet

Nested Class Summary
 
Nested classes inherited from class javax.management.StandardMBean
 
Field Summary
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
logger, macroHandler, parsingGranularity, raidbLevel, totalOrderQueue, vdb
 
Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
 
Fields inherited from class javax.management.StandardMBean
 
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION
 
Constructor Summary
ParallelDB_LPRF(VirtualDatabase vdb)
          Creates a new ParallelDB_LPRF object.
 
Method Summary
 DatabaseBackend chooseBackendForReadRequest(AbstractRequest request)
          Choose a backend using the implementation specific load balancing algorithm for read request execution.
 DatabaseBackend chooseBackendForWriteRequest(AbstractWriteRequest request)
          Choose a backend using the implementation specific load balancing algorithm for write request execution.
 java.lang.String getInformation()
          Get information about the Request Load Balancer
 java.lang.String getParallelDBXml()
          Return the XML tags of the ParallelDB load balancer implementation.
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB
begin, commit, disableBackend, enableBackend, execReadOnlyReadStoredProcedure, execReadRequest, execReadStoredProcedure, execWriteRequest, execWriteRequestWithKeys, execWriteStoredProcedure, getNumberOfEnabledBackends, getXmlImpl, releaseSavepoint, rollback, rollback, setSavepoint
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
executeReadStoredProcedureOnBackend, executeSelectRequestOnBackend, executeUpdateRequestOnBackend, executeUpdateRequestOnBackendWithKeys, executeWriteStoredProcedureOnBackend, getAssociatedString, getConnectionAndBeginTransaction, getParsingGranularity, getRAIDbLevel, getXml, handleMacros, removeHeadFromAndNotifyTotalOrderQueue, setMacroHandler, setParsingGranularity, setRAIDbLevel, setWeight, waitForTotalOrder
 
Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelDB_LPRF

public ParallelDB_LPRF(VirtualDatabase vdb)
                throws java.lang.Exception
Creates a new ParallelDB_LPRF object.

Parameters:
vdb - the virtual database this load balancer belongs to.
Throws:
java.lang.Exception - if an error occurs
Method Detail

chooseBackendForReadRequest

public DatabaseBackend chooseBackendForReadRequest(AbstractRequest request)
                                            throws java.sql.SQLException
Description copied from class: ParallelDB
Choose a backend using the implementation specific load balancing algorithm for read request execution.

Specified by:
chooseBackendForReadRequest in class ParallelDB
Parameters:
request - request to execute
Returns:
the chosen backend
Throws:
java.sql.SQLException - if an error occurs
See Also:
ParallelDB.chooseBackendForReadRequest(org.objectweb.cjdbc.common.sql.AbstractRequest)

chooseBackendForWriteRequest

public DatabaseBackend chooseBackendForWriteRequest(AbstractWriteRequest request)
                                             throws java.sql.SQLException
Description copied from class: ParallelDB
Choose a backend using the implementation specific load balancing algorithm for write request execution.

Specified by:
chooseBackendForWriteRequest in class ParallelDB
Parameters:
request - request to execute
Returns:
the chosen backend
Throws:
java.sql.SQLException - if an error occurs
See Also:
ParallelDB.chooseBackendForWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)

getInformation

public java.lang.String getInformation()
Description copied from class: AbstractLoadBalancer
Get information about the Request Load Balancer

Specified by:
getInformation in interface AbstractLoadBalancerMBean
Specified by:
getInformation in class AbstractLoadBalancer
Returns:
String containing information
See Also:
AbstractLoadBalancer.getInformation()

getParallelDBXml

public java.lang.String getParallelDBXml()
Description copied from class: ParallelDB
Return the XML tags of the ParallelDB load balancer implementation.

Specified by:
getParallelDBXml in class ParallelDB
Returns:
content of ParallelDB xml
See Also:
ParallelDB.getParallelDBXml()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.