diff options
author | Bernard Normier <bernard@zeroc.com> | 2009-01-23 17:07:21 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2009-01-23 17:07:21 -0500 |
commit | 2380e089401d048490da23bc6d71e5687bafbe47 (patch) | |
tree | 6d97052d1f93bc2bafcd7fd1a9ebe103544b6cad /cpp/src/IceGrid/AdapterCache.cpp | |
parent | Fixed permissions (diff) | |
parent | 3.3.1 third-party updates (diff) | |
download | ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.bz2 ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.xz ice-2380e089401d048490da23bc6d71e5687bafbe47.zip |
Merge branch 'R3_3_branch' of cvs:/home/git/ice into R3_3_branch
Conflicts:
java/resources/IceGridAdmin/icegridadmin_content_dyn.html
java/resources/IceGridAdmin/icegridadmin_content_static.html
Diffstat (limited to 'cpp/src/IceGrid/AdapterCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/AdapterCache.cpp | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index 1fdb9bbcfd5..af24d9da061 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -231,7 +231,7 @@ ServerAdapterEntry::ServerAdapterEntry(AdapterCache& cache, void ServerAdapterEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& nReplicas, bool& replicaGroup, - bool& roundRobin) + bool& roundRobin, const set<string>&) { nReplicas = 1; replicaGroup = false; @@ -242,11 +242,6 @@ ServerAdapterEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& adapters.push_back(info); } -void -ServerAdapterEntry::increaseRoundRobinCount(int roundRobinCount) -{ -} - float ServerAdapterEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const { @@ -383,7 +378,7 @@ ReplicaGroupEntry::update(const LoadBalancingPolicyPtr& policy) void ReplicaGroupEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& nReplicas, bool& replicaGroup, - bool& roundRobin) + bool& roundRobin, const set<string>& excludes) { vector<ServerAdapterEntryPtr> replicas; bool adaptive = false; @@ -453,32 +448,28 @@ ReplicaGroupEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& n // for(vector<ServerAdapterEntryPtr>::const_iterator p = replicas.begin(); p != replicas.end(); ++p) { - try - { - int dummy; - bool dummy2; - bool dummy3; - (*p)->getLocatorAdapterInfo(adapters, dummy, dummy2, dummy3); - } - catch(const AdapterNotExistException&) - { - } - catch(const NodeUnreachableException&) - { - } - catch(const DeploymentException&) + if(!roundRobin || excludes.find((*p)->getId()) == excludes.end()) { + try + { + int dummy; + bool dummy2; + bool dummy3; + (*p)->getLocatorAdapterInfo(adapters, dummy, dummy2, dummy3, set<string>()); + } + catch(const AdapterNotExistException&) + { + } + catch(const NodeUnreachableException&) + { + } + catch(const DeploymentException&) + { + } } } } -void -ReplicaGroupEntry::increaseRoundRobinCount(int count) -{ - Lock sync(*this); - _lastReplica = (_lastReplica + count) % static_cast<int>(_replicas.size()); -} - float ReplicaGroupEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const { |