1
0
Fork 0

server health for aardvark

This commit is contained in:
Kaveh Vahedipour 2016-06-03 13:44:50 +02:00
parent b93981df61
commit 2ab638160e
2 changed files with 12 additions and 10 deletions

View File

@ -39,17 +39,17 @@ namespace consensus {
enum JOB_STATUS {TODO, PENDING, FINISHED, FAILED, NOTFOUND};
static std::string const pendingPrefix = "/Target/Pending/";
static std::string const pendingPrefix = "/Target/Pending/";
static std::string const failedPrefix = "/Target/Failed/";
static std::string const finishedPrefix = "/Target/Finished/";
static std::string const failedPrefix = "/Target/Failed/";
static std::string const cleanedPrefix = "Target/CleanedServers";
static std::string const planColPrefix = "/Plan/Collections/";
static std::string const curColPrefix = "/Current/Collections/";
static std::string const toDoPrefix = "/Target/ToDo/";
static std::string const toDoPrefix = "/Target/ToDo/";
static std::string const cleanedPrefix = "Target/CleanedServers";
static std::string const planColPrefix = "/Plan/Collections/";
static std::string const curColPrefix = "/Current/Collections/";
static std::string const blockedServersPrefix = "/Supervision/DBServers/";
static std::string const blockedShardsPrefix = "/Supervision/Shards/";
static std::string const serverStatePrefix = "/Sync/ServerStates/";
static std::string const planVersion = "/Plan/Version";
static std::string const planVersion = "/Plan/Version";
struct JobResult {
JobResult() {}

View File

@ -265,11 +265,13 @@ void Supervision::run() {
void Supervision::workJobs() {
_snapshot = _agent->readDB().get("/");
Node::Children const& todos = _snapshot(toDoPrefix).children();
Node::Children const& pends = _snapshot(pendingPrefix).children();
if (!todos.empty()) {
for (auto const& todoEnt : todos) {
Node const& job = *todoEnt.second;
LOG(WARN) << __FILE__<<__LINE__ << job.toJson();
std::string jobType = job("type").getString(),
jobId = job("jobId").getString(),
creator = job("creator").getString();
@ -280,11 +282,11 @@ void Supervision::workJobs() {
}
}
}
Node::Children const& pends = _snapshot(pendingPrefix).children();
if (!pends.empty()) {
for (auto const& pendEnt : pends) {
Node const& job = *pendEnt.second;
LOG(WARN) << __FILE__<<__LINE__ << job.toJson();
std::string jobType = job("type").getString(),
jobId = job("jobId").getString(),
creator = job("creator").getString();