mirror of https://gitee.com/bigwinds/arangodb
Finish renaming ServerJob -> DBServerAgencySync.
This commit is contained in:
parent
d1bff377d5
commit
f1bb21b3a7
|
@ -21,7 +21,7 @@
|
||||||
/// @author Jan Steemann
|
/// @author Jan Steemann
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "ServerJob.h"
|
#include "DBServerAgencySync.h"
|
||||||
|
|
||||||
#include "Basics/MutexLocker.h"
|
#include "Basics/MutexLocker.h"
|
||||||
#include "Cluster/ClusterInfo.h"
|
#include "Cluster/ClusterInfo.h"
|
||||||
|
@ -47,8 +47,8 @@ static arangodb::Mutex ExecutorLock;
|
||||||
/// @brief constructs a new db server job
|
/// @brief constructs a new db server job
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ServerJob::ServerJob(HeartbeatThread* heartbeat)
|
DBServerAgencySync::DBServerAgencySync(HeartbeatThread* heartbeat)
|
||||||
: Job("HttpServerJob"),
|
: Job("DBServerAgencySync"),
|
||||||
_heartbeat(heartbeat),
|
_heartbeat(heartbeat),
|
||||||
_shutdown(0),
|
_shutdown(0),
|
||||||
_abandon(false) {}
|
_abandon(false) {}
|
||||||
|
@ -57,9 +57,9 @@ ServerJob::ServerJob(HeartbeatThread* heartbeat)
|
||||||
/// @brief destructs a db server job
|
/// @brief destructs a db server job
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ServerJob::~ServerJob() {}
|
DBServerAgencySync::~DBServerAgencySync() {}
|
||||||
|
|
||||||
void ServerJob::work() {
|
void DBServerAgencySync::work() {
|
||||||
LOG(TRACE) << "starting plan update handler";
|
LOG(TRACE) << "starting plan update handler";
|
||||||
|
|
||||||
if (_shutdown != 0) {
|
if (_shutdown != 0) {
|
||||||
|
@ -68,7 +68,7 @@ void ServerJob::work() {
|
||||||
|
|
||||||
_heartbeat->setReady();
|
_heartbeat->setReady();
|
||||||
|
|
||||||
ServerJobResult result;
|
DBServerAgencySyncResult result;
|
||||||
{
|
{
|
||||||
// only one plan change at a time
|
// only one plan change at a time
|
||||||
MUTEX_LOCKER(mutexLocker, ExecutorLock);
|
MUTEX_LOCKER(mutexLocker, ExecutorLock);
|
||||||
|
@ -79,9 +79,9 @@ void ServerJob::work() {
|
||||||
_heartbeat->removeDispatchedJob(result);
|
_heartbeat->removeDispatchedJob(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerJob::cancel() { return false; }
|
bool DBServerAgencySync::cancel() { return false; }
|
||||||
|
|
||||||
void ServerJob::cleanup(DispatcherQueue* queue) {
|
void DBServerAgencySync::cleanup(DispatcherQueue* queue) {
|
||||||
queue->removeJob(this);
|
queue->removeJob(this);
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void ServerJob::cleanup(DispatcherQueue* queue) {
|
||||||
/// @brief execute job
|
/// @brief execute job
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ServerJobResult ServerJob::execute() {
|
DBServerAgencySyncResult DBServerAgencySync::execute() {
|
||||||
// default to system database
|
// default to system database
|
||||||
|
|
||||||
DatabaseFeature* database =
|
DatabaseFeature* database =
|
||||||
|
@ -98,7 +98,7 @@ ServerJobResult ServerJob::execute() {
|
||||||
|
|
||||||
TRI_vocbase_t* const vocbase = database->vocbase();
|
TRI_vocbase_t* const vocbase = database->vocbase();
|
||||||
|
|
||||||
ServerJobResult result;
|
DBServerAgencySyncResult result;
|
||||||
if (vocbase == nullptr) {
|
if (vocbase == nullptr) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,28 +34,28 @@
|
||||||
namespace arangodb {
|
namespace arangodb {
|
||||||
class HeartbeatThread;
|
class HeartbeatThread;
|
||||||
|
|
||||||
struct ServerJobResult {
|
struct DBServerAgencySyncResult {
|
||||||
bool success;
|
bool success;
|
||||||
uint64_t planVersion;
|
uint64_t planVersion;
|
||||||
uint64_t currentVersion;
|
uint64_t currentVersion;
|
||||||
|
|
||||||
ServerJobResult() : success(false), planVersion(0), currentVersion(0) {
|
DBServerAgencySyncResult() : success(false), planVersion(0), currentVersion(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerJobResult(const ServerJobResult& other)
|
DBServerAgencySyncResult(const DBServerAgencySyncResult& other)
|
||||||
: success(other.success),
|
: success(other.success),
|
||||||
planVersion(other.planVersion),
|
planVersion(other.planVersion),
|
||||||
currentVersion(other.currentVersion) {
|
currentVersion(other.currentVersion) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ServerJob : public arangodb::rest::Job {
|
class DBServerAgencySync : public arangodb::rest::Job {
|
||||||
ServerJob(ServerJob const&) = delete;
|
DBServerAgencySync(DBServerAgencySync const&) = delete;
|
||||||
ServerJob& operator=(ServerJob const&) = delete;
|
DBServerAgencySync& operator=(DBServerAgencySync const&) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ServerJob(HeartbeatThread* heartbeat);
|
explicit DBServerAgencySync(HeartbeatThread* heartbeat);
|
||||||
~ServerJob();
|
~DBServerAgencySync();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -88,7 +88,7 @@ class ServerJob : public arangodb::rest::Job {
|
||||||
/// @brief execute job
|
/// @brief execute job
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ServerJobResult execute();
|
DBServerAgencySyncResult execute();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue