diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-11-23 14:44:51 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-11-23 14:44:51 +0000 |
commit | ad476fdda5c9a9f23b9e65fc3c4b3016f7704848 (patch) | |
tree | 329b46efefd33095fe3ed8dc92ef3d8726cd0857 /cpp/src/IceGrid/Database.cpp | |
parent | Remove deprecated methods (diff) | |
download | ice-ad476fdda5c9a9f23b9e65fc3c4b3016f7704848.tar.bz2 ice-ad476fdda5c9a9f23b9e65fc3c4b3016f7704848.tar.xz ice-ad476fdda5c9a9f23b9e65fc3c4b3016f7704848.zip |
Code cleanup and fixed startup scalability issue of the registry (it no
longer contacts all the nodes).
Diffstat (limited to 'cpp/src/IceGrid/Database.cpp')
-rw-r--r-- | cpp/src/IceGrid/Database.cpp | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 9b33ce7917a..d9126730814 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -382,7 +382,7 @@ Database::addApplication(const ApplicationInfo& info, AdminSessionI* session) { try { - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::load)); } catch(const DeploymentException& ex) { @@ -595,7 +595,7 @@ Database::removeApplication(const string& name, AdminSessionI* session) { try { - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::load)); } catch(const DeploymentException&) { @@ -638,6 +638,12 @@ Database::addNode(const string& name, const NodeSessionIPtr& session) addInternalObject(info, true); } +void +Database::setNodeProxy(const string& name, const NodePrx& node) +{ + _nodeCache.get(name)->setProxy(node); +} + NodePrx Database::getNode(const string& name) const { @@ -730,7 +736,7 @@ Database::waitForApplicationReplication(const AMD_NodeSession_waitForApplication } void -Database::removeReplica(const string& name, const ReplicaSessionIPtr& session, bool shutdown) +Database::removeReplica(const string& name, bool shutdown) { _registryObserverTopic->registryDown(name); _replicaCache.remove(name, shutdown); @@ -742,6 +748,30 @@ Database::getAllReplicas(const string& expression) return _replicaCache.getAll(expression); } +void +Database::setInternalRegistry(const InternalRegistryPrx& proxy) +{ + _replicaCache.setInternalRegistry(proxy); +} + +InternalRegistryPrx +Database::getInternalRegistry() const +{ + return _replicaCache.getInternalRegistry(); +} + +void +Database::loadServer(const std::string& id) +{ + _serverCache.get(id)->load(); +} + +void +Database::unloadServer(const std::string& id) +{ + _serverCache.get(id)->unload(); +} + ServerInfo Database::getServerInfo(const std::string& id, bool resolve) { @@ -1659,12 +1689,12 @@ Database::finishApplicationUpdate(ServerEntrySeq& entries, if(_master) { // - // Synchronize the servers on the nodes. If a server couldn't be + // Load the servers on the nodes. If a server couldn't be // deployed we unload the application and throw. // try { - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::load)); } catch(const DeploymentException& ex) { @@ -1681,7 +1711,7 @@ Database::finishApplicationUpdate(ServerEntrySeq& entries, try { - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::load)); } catch(const DeploymentException& ex) { |