FastRestore:fix compilation error for version batch state

This commit is contained in:
Meng Xu 2020-02-27 20:59:34 -08:00
parent fe8b8bbbff
commit a6e66da29f
3 changed files with 14 additions and 7 deletions

View File

@ -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<ApplierBatchData> {

View File

@ -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<RestoreLoade
return ss.str();
}
std::string getVersionBatchState(int batchIndex) {
int getVersionBatchState(int batchIndex) {
std::map<int, Reference<LoaderBatchData>>::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<int, Reference<LoaderBatchData>>::iterator item = batch.find(batchIndex);
ASSERT(item != batch.end());
item->second->vbState = (LoaderVersionBatchState) vbState;
item->second->vbState = vbState;
}
void initVersionBatch(int batchIndex) {

View File

@ -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;