summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/AdapterCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/AdapterCache.cpp')
-rw-r--r--cpp/src/IceGrid/AdapterCache.cpp49
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
{