summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/Util.cpp
diff options
context:
space:
mode:
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