Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[7172b2]: src / plugins / MHiveStorage / services / engines / redundant_engine / RedundantEngine.cpp Maximize Restore History

Download this file

RedundantEngine.cpp    59 lines (45 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "RedundantEngine.h"
#include "org/esb/util/Log.h"
#include "org/esb/util/Foreach.h"
#include "org/esb/util/StringTokenizer.h"
using org::esb::util::StringTokenizer;
using Poco::Net::HTTPClientSession;
namespace mhivestorage{
namespace engines {
RedundantEngine::RedundantEngine(db::HiveDb database, std::string storage_path, std::vector<std::string> hosts, int self_port) : Simple(database, storage_path), _mutex(self_port, hosts)
{
std::vector<mongo::HostAndPort>rs_hosts;
foreach(std::string host, hosts){
rs_hosts.push_back(mongo::HostAndPort(host));
}
mongo::DBClientReplicaSet * dbcrs=new mongo::DBClientReplicaSet("first", rs_hosts);
// c=new mongo::DBClientConnection(true, dbcrs);
}
void RedundantEngine::put(boost::shared_ptr<org::esb::hive::job::ProcessUnit>unit)
{
Simple::put(unit);
}
boost::shared_ptr<org::esb::hive::job::ProcessUnit> RedundantEngine::get()
{
return Simple::get();
}
void RedundantEngine::enque(boost::shared_ptr<org::esb::hive::job::ProcessUnit>unit)
{
Simple::enque(unit);
/*distributeing the process units*/
}
boost::shared_ptr<org::esb::hive::job::ProcessUnit> RedundantEngine::deque()
{
//boost::mutex::scoped_lock enqueue_lock(_mutex);
return Simple::deque();
}
void RedundantEngine::commit(std::string uuid)
{
Simple::commit(uuid);
}
void RedundantEngine::rollback(std::string uuid)
{
Simple::rollback(uuid);
}
}
}