org.objectweb.cjdbc.controller.loadbalancer.raidb1
Class RAIDb1ec

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
      extended byorg.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1
          extended byorg.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1ec
Direct Known Subclasses:
RAIDb1ec_RR, RAIDb1ec_WRR

public abstract class RAIDb1ec
extends RAIDb1

RAIDb-1 load balancer.

This class is an abstract call because the read requests coming from the request manager are NOT treated here but in the subclasses. Transaction management and write requests are broadcasted to all backends.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
protected  java.util.ArrayList backendReadThreads
           
protected  ErrorCheckingPolicy errorCheckingPolicy
           
protected static Trace logger
           
protected  int nbOfConcurrentReads
           
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1
backendBlockingThreads, backendBlockingThreadsRWLock, backendNonBlockingThreads, backendNonBlockingThreadsRWLock
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
parsingGranularity, raidbLevel, vdb
 
Constructor Summary
RAIDb1ec(VirtualDatabase vdb, WaitForCompletionPolicy waitForCompletionPolicy, ErrorCheckingPolicy errorCheckingPolicy, int nbOfConcurrentReads)
          Creates a new RAIDb-1 Round Robin request load balancer.
 
Method Summary
 void disableBackend(DatabaseBackend db)
          Disables a backend that was previously enabled.
 void enableBackend(DatabaseBackend db)
          Enables a backend that was previously disabled.
 java.lang.String getXmlInformation()
          Get information about the Request Load Balancer in xml
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1
begin, commit, execReadRequest, execReadStoredProcedure, executeRequest, execWriteRequest, execWriteRequestWithKeys, execWriteStoredProcedure, getRaidb1Xml, getXmlWaitPolicy, rollback, waitForAllWritesToComplete, waitForAllWritesToComplete, waitForAllWritesToComplete
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer
getInformation, getParsingGranularity, getRAIDbLevel, setParsingGranularity, setRAIDbLevel, setWeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backendReadThreads

protected java.util.ArrayList backendReadThreads

nbOfConcurrentReads

protected int nbOfConcurrentReads

errorCheckingPolicy

protected ErrorCheckingPolicy errorCheckingPolicy

logger

protected static Trace logger
Constructor Detail

RAIDb1ec

public RAIDb1ec(VirtualDatabase vdb,
                WaitForCompletionPolicy waitForCompletionPolicy,
                ErrorCheckingPolicy errorCheckingPolicy,
                int nbOfConcurrentReads)
         throws java.sql.SQLException
Creates a new RAIDb-1 Round Robin request load balancer. A new backend worker thread is created for each backend.

Parameters:
vdb - the virtual database this load balancer belongs to
waitForCompletionPolicy - how many backends must complete before returning the result?
errorCheckingPolicy - policy to apply for error checking.
nbOfConcurrentReads - number of concurrent reads allowed
Throws:
java.sql.SQLException - if an error occurs
Method Detail

enableBackend

public void enableBackend(DatabaseBackend db)
                   throws java.sql.SQLException
Enables a backend that was previously disabled.

Ask the corresponding connection manager to initialize the connections if needed.

No sanity checks are performed by this function.

Overrides:
enableBackend in class RAIDb1
Parameters:
db - the database backend to enable
Throws:
java.sql.SQLException - if an error occurs

disableBackend

public void disableBackend(DatabaseBackend db)
                    throws java.sql.SQLException
Disables a backend that was previously enabled.

Ask the corresponding connection manager to finalize the connections if needed.

No sanity checks are performed by this function.

Overrides:
disableBackend in class RAIDb1
Parameters:
db - the database backend to disable
Throws:
java.sql.SQLException - if an error occurs

getXmlInformation

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

Overrides:
getXmlInformation in class RAIDb1
See Also:
AbstractLoadBalancer.getXmlInformation()


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