summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/Util.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-04-18 18:31:48 +0200
committerJose <jose@zeroc.com>2014-04-18 18:31:48 +0200
commite7333297345efda9379045495d17aadb571ddd50 (patch)
tree5bfa86a78d29665e1ef50a9575b76114be1145e1 /cpp/src/IceStorm/Util.cpp
parentFixed replicaGroup test issue (diff)
downloadice-e7333297345efda9379045495d17aadb571ddd50.tar.bz2
ice-e7333297345efda9379045495d17aadb571ddd50.tar.xz
ice-e7333297345efda9379045495d17aadb571ddd50.zip
Fixed (ICE-4858) - Eliminate IceDB
Diffstat (limited to 'cpp/src/IceStorm/Util.cpp')
-rw-r--r--cpp/src/IceStorm/Util.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/cpp/src/IceStorm/Util.cpp b/cpp/src/IceStorm/Util.cpp
index 6b17ece600e..112cdac906e 100644
--- a/cpp/src/IceStorm/Util.cpp
+++ b/cpp/src/IceStorm/Util.cpp
@@ -8,7 +8,11 @@
// **********************************************************************
#include <IceStorm/Util.h>
+#include <IceStorm/LLUMap.h>
+using namespace Freeze;
+using namespace IceStormElection;
+using namespace IceStorm;
using namespace std;
string
@@ -33,3 +37,34 @@ IceStormInternal::describeEndpoints(const Ice::ObjectPrx& proxy)
}
return os.str();
}
+
+namespace
+{
+
+const string lluDbName = "llu";
+
+}
+
+void
+IceStormInternal::putLLU(const ConnectionPtr& connection, const LogUpdate& llu)
+{
+ LLUMap llumap(connection, lluDbName);
+ LLUMap::iterator ci = llumap.find("_manager");
+ if(ci == llumap.end())
+ {
+ llumap.put(LLUMap::value_type("_manager", llu));
+ }
+ else
+ {
+ ci.set(llu);
+ }
+}
+
+LogUpdate
+IceStormInternal::getLLU(const ConnectionPtr& connection)
+{
+ LLUMap llumap(connection, lluDbName);
+ LLUMap::iterator ci = llumap.find("_manager");
+ assert(ci != llumap.end());
+ return ci->second;
+} \ No newline at end of file