From a6e66da29fb8d40e7443dc1f601d32349b4b11bb Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Thu, 27 Feb 2020 20:59:34 -0800 Subject: [PATCH] FastRestore:fix compilation error for version batch state --- fdbserver/RestoreApplier.actor.h | 5 ++++- fdbserver/RestoreLoader.actor.h | 13 ++++++++----- fdbserver/RestoreRoleCommon.actor.h | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/fdbserver/RestoreApplier.actor.h b/fdbserver/RestoreApplier.actor.h index a4f07a782a..3b6585d1e0 100644 --- a/fdbserver/RestoreApplier.actor.h +++ b/fdbserver/RestoreApplier.actor.h @@ -203,13 +203,16 @@ struct StagingKeyRange { // Applier state in each verion batch class ApplierVersionBatchState : RoleVersionBatchState { +public: static const int NOT_INIT = 0; static const int INIT = 1; static const int RECEIVE_MUTATIONS = 2; static const int WRITE_TO_DB = 3; static const int INVALID = 4; - explicit ApplierVersionBatchState(int newState) : vbState(newState) {} + explicit ApplierVersionBatchState(int newState) { + vbState = newState; + } }; struct ApplierBatchData : public ReferenceCounted { diff --git a/fdbserver/RestoreLoader.actor.h b/fdbserver/RestoreLoader.actor.h index 8a8bdeb376..a1337299d6 100644 --- a/fdbserver/RestoreLoader.actor.h +++ b/fdbserver/RestoreLoader.actor.h @@ -43,13 +43,16 @@ #include "flow/actorcompiler.h" // has to be last include class LoaderVersionBatchState : RoleVersionBatchState { +public: static const int NOT_INIT = 0; static const int INIT = 1; static const int LOAD_FILE = 2; static const int SEND_MUTATIONS = 3; static const int INVALID = 4; - explicit LoaderVersionBatchState(int newState) : vbState(newState) {} + explicit LoaderVersionBatchState(int newState) { + vbState = newState; + } // static std::string getVersionBatchState(int vbState) { // switch(vbSTate) { @@ -152,15 +155,15 @@ struct RestoreLoaderData : RestoreRoleData, public ReferenceCounted>::iterator item = batch.find(batchIndex); ASSERT(item != batch.end()); - return item->second->vbState; + return item->second->vbState.get(); } - void setVersionBatchState(int batchIndex, RoleVersionBatchState vbState) { + void setVersionBatchState(int batchIndex, int vbState) { std::map>::iterator item = batch.find(batchIndex); ASSERT(item != batch.end()); - item->second->vbState = (LoaderVersionBatchState) vbState; + item->second->vbState = vbState; } void initVersionBatch(int batchIndex) { diff --git a/fdbserver/RestoreRoleCommon.actor.h b/fdbserver/RestoreRoleCommon.actor.h index 0cbb5d7bc3..405ea7a596 100644 --- a/fdbserver/RestoreRoleCommon.actor.h +++ b/fdbserver/RestoreRoleCommon.actor.h @@ -113,10 +113,11 @@ public: return vbState; } - operator = (int newState) { + void operator = (int newState) { vbState = newState; } + explicit RoleVersionBatchState() : vbState(INVALID) {} explicit RoleVersionBatchState(int newState) : vbState(newState) {} int vbState;