1 24 25 package org.objectweb.cjdbc.controller.loadbalancer.raidb2; 26 27 import java.sql.SQLException ; 28 import java.util.Vector ; 29 30 import org.objectweb.cjdbc.common.exceptions.NotImplementedException; 31 import org.objectweb.cjdbc.common.sql.SelectRequest; 32 import org.objectweb.cjdbc.common.sql.StoredProcedure; 33 import org.objectweb.cjdbc.common.xml.DatabasesXmlTags; 34 import org.objectweb.cjdbc.controller.cache.metadata.MetadataCache; 35 import org.objectweb.cjdbc.controller.loadbalancer.policies.WaitForCompletionPolicy; 36 import org.objectweb.cjdbc.controller.loadbalancer.policies.createtable.CreateTablePolicy; 37 import org.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking.ErrorCheckingPolicy; 38 import org.objectweb.cjdbc.controller.virtualdatabase.ControllerResultSet; 39 import org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase; 40 41 52 public class RAIDb2ec_RR extends RAIDb2ec 53 { 54 58 59 private Vector backends; 60 61 64 65 78 public RAIDb2ec_RR(VirtualDatabase vdb, 79 WaitForCompletionPolicy waitForCompletionPolicy, 80 CreateTablePolicy createTablePolicy, 81 ErrorCheckingPolicy errorCheckingPolicy, int nbOfConcurrentReads) 82 throws Exception 83 { 84 super(vdb, waitForCompletionPolicy, createTablePolicy, errorCheckingPolicy, 85 nbOfConcurrentReads); 86 } 87 88 91 92 103 public ControllerResultSet execReadRequest(SelectRequest request, 104 MetadataCache metadataCache) throws SQLException 105 { 106 throw new NotImplementedException(this.getClass().getName() 107 + ":execReadRequest"); 108 } 109 110 116 public ControllerResultSet execReadOnlyReadStoredProcedure( 117 StoredProcedure proc, MetadataCache metadataCache) throws SQLException 118 { 119 throw new NotImplementedException(this.getClass().getName() 120 + ":execReadStoredProcedure"); 121 } 122 123 126 127 132 public String getInformation() 133 { 134 if (backends == null) 135 return "RAIDb-2 Error Checking with Round Robin Request load balancer: !!!Warning!!! No backend nodes found\n"; 136 else 137 return "RAIDb-2 Error Checking with Round Robin Request load balancer balancing over " 138 + backends.size() + " nodes\n"; 139 } 140 141 144 public String getRaidb2Xml() 145 { 146 return "<" + DatabasesXmlTags.ELT_RAIDb_2ec_RoundRobin + "/>"; 147 } 148 } | Popular Tags |