|
|
Choosing A Webhost: |
CVS update of BRANCH_sequoia-2_10 <src>/org/continuent/sequoia/controller/l: msg#00091db.sequoia.cvs
Date: Wednesday, November 22, 2006 @ 15:40:07 Author: stephane Path: .../sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1 Tag: BRANCH_sequoia-2_10 Modified: RAIDb1_WRR.java (1.12 -> 1.12.2.1) Backport SEQUOIA-850 into maintenance branch -----------------+ RAIDb1_WRR.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1/RAIDb1_WRR.java diff -u sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1/RAIDb1_WRR.java:1.12 sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1/RAIDb1_WRR.java:1.12.2.1 --- sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1/RAIDb1_WRR.java:1.12 Wed Jul 19 11:13:55 2006 +++ sequoia/src/org/continuent/sequoia/controller/loadbalancer/raidb1/RAIDb1_WRR.java Wed Nov 22 15:40:07 2006 @@ -92,7 +92,7 @@ WaitForCompletionPolicy waitForCompletionPolicy) throws Exception { super(vdb, waitForCompletionPolicy); - currentWeight = -1; + currentWeight = 0; } /* @@ -188,6 +188,7 @@ // Choose the backend (WRR algorithm starts here) int w = 0; // cumulative weight + boolean backendFound = false; for (int i = 0; i < size; i++) { DatabaseBackend b = (DatabaseBackend) backends.get(i); @@ -210,10 +211,10 @@ } // Ok we reached the needed weight, take this backend - if (currentWeight <= w) + if (currentWeight < w) { backend = b; - currentWeight++; // Next time take the next + backendFound = true; break; } } @@ -226,7 +227,9 @@ // We are over the total weight and we are using the // first available node. Let's reset the index to 1 // since we used this first node (0++). - if (currentWeight > w) + if (backendFound) + currentWeight++; // Next time take the next + else currentWeight = 1; } catch (RuntimeException e)
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of <src>/org/continuent/sequoia (5 files), olivier-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of BRANCH_sequoia-2_10 <src>/org/continuent/sequoia/controller/backup (1 file), stephane-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of <src>/org/continuent/sequoia (5 files), olivier-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of BRANCH_sequoia-2_10 <src>/org/continuent/sequoia/controller/backup (1 file), stephane-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |