From ef9dcd545c6e5cbcf97ee5e293f163687e4af08d Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Sat, 11 May 2019 23:55:20 -0700 Subject: [PATCH] FastRestore: Resolve review comments 1) Add type for RestoreCommandEnum 2) Make RestoreRoleStr const --- fdbserver/RestoreUtil.actor.cpp | 2 +- fdbserver/RestoreUtil.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fdbserver/RestoreUtil.actor.cpp b/fdbserver/RestoreUtil.actor.cpp index ed54d2ef6b..921961b0f7 100644 --- a/fdbserver/RestoreUtil.actor.cpp +++ b/fdbserver/RestoreUtil.actor.cpp @@ -22,7 +22,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. -std::vector RestoreRoleStr = {"Invalid", "Master", "Loader", "Applier"}; +const std::vector RestoreRoleStr = {"Invalid", "Master", "Loader", "Applier"}; int numRoles = RestoreRoleStr.size(); std::string getRoleStr(RestoreRole role) { diff --git a/fdbserver/RestoreUtil.h b/fdbserver/RestoreUtil.h index 103545d8ec..65c9dc54e1 100644 --- a/fdbserver/RestoreUtil.h +++ b/fdbserver/RestoreUtil.h @@ -30,10 +30,11 @@ #include "flow/Stats.h" #include "fdbrpc/fdbrpc.h" #include "fdbrpc/IAsyncFile.h" +#include // TODO: To remove unused command enum. and re-order the command sequence // RestoreCommandEnum is also used as the phase ID for CMDUID -enum class RestoreCommandEnum {Init = 0, +enum class RestoreCommandEnum : uint32_t {Init = 0, Sample_Range_File, Sample_Log_File, Sample_File_Done, Loader_Send_Sample_Mutation_To_Applier, Loader_Send_Sample_Mutation_To_Applier_Done, //5 Calculate_Applier_KeyRange, Get_Applier_KeyRange, Get_Applier_KeyRange_Done, //8 @@ -50,7 +51,7 @@ BINARY_SERIALIZABLE(RestoreCommandEnum); enum class RestoreRole {Invalid = 0, Master = 1, Loader, Applier}; BINARY_SERIALIZABLE( RestoreRole ); -extern std::vector RestoreRoleStr; +extern const std::vector RestoreRoleStr; extern int numRoles; std::string getRoleStr(RestoreRole role);