diff --git a/fdbbackup/backup.actor.cpp b/fdbbackup/backup.actor.cpp index a2d3c1e275..ef9160af3a 100644 --- a/fdbbackup/backup.actor.cpp +++ b/fdbbackup/backup.actor.cpp @@ -3735,7 +3735,7 @@ int main(int argc, char* argv[]) { f = stopAfter( map(ba.abortRestore(db, KeyRef(tagName)), [tagName](FileBackupAgent::ERestoreState s) -> Void { printf("RESTORE_ABORT Tag: %s State: %s\n", tagName.c_str(), - FileBackupAgent::restoreStateText(s).c_str()); + FileBackupAgent::restoreStateText(s).toString().c_str()); return Void(); })); break; diff --git a/fdbclient/BackupAgent.actor.h b/fdbclient/BackupAgent.actor.h index ad717744d7..fc1078a205 100644 --- a/fdbclient/BackupAgent.actor.h +++ b/fdbclient/BackupAgent.actor.h @@ -273,7 +273,7 @@ public: /** RESTORE **/ enum ERestoreState { UNITIALIZED = 0, QUEUED = 1, STARTING = 2, RUNNING = 3, COMPLETED = 4, ABORTED = 5 }; - static std::string restoreStateText(ERestoreState id); + static StringRef restoreStateText(ERestoreState id); // parallel restore Future parallelRestoreFinish(Database cx, UID randomUID, bool unlockDB = true); diff --git a/fdbclient/FileBackupAgent.actor.cpp b/fdbclient/FileBackupAgent.actor.cpp index be681793d8..3a7ffc17c6 100644 --- a/fdbclient/FileBackupAgent.actor.cpp +++ b/fdbclient/FileBackupAgent.actor.cpp @@ -87,22 +87,15 @@ const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable // For convenience typedef FileBackupAgent::ERestoreState ERestoreState; -std::string FileBackupAgent::restoreStateText(ERestoreState id) { +StringRef FileBackupAgent::restoreStateText(ERestoreState id) { switch(id) { - case ERestoreState::UNITIALIZED: - return "unitialized"; - case ERestoreState::QUEUED: - return "queued"; - case ERestoreState::STARTING: - return "starting"; - case ERestoreState::RUNNING: - return "running"; - case ERestoreState::COMPLETED: - return "completed"; - case ERestoreState::ABORTED: - return "aborted"; - default: - return "Unknown"; + case ERestoreState::UNITIALIZED: return LiteralStringRef("unitialized"); + case ERestoreState::QUEUED: return LiteralStringRef("queued"); + case ERestoreState::STARTING: return LiteralStringRef("starting"); + case ERestoreState::RUNNING: return LiteralStringRef("running"); + case ERestoreState::COMPLETED: return LiteralStringRef("completed"); + case ERestoreState::ABORTED: return LiteralStringRef("aborted"); + default: return LiteralStringRef("Unknown"); } } @@ -3975,7 +3968,7 @@ public: if(!current.present()) { if(verbose) printf("waitRestore: Tag: %s State: %s\n", tagName.toString().c_str(), - FileBackupAgent::restoreStateText(ERestoreState::UNITIALIZED).c_str()); + FileBackupAgent::restoreStateText(ERestoreState::UNITIALIZED).toString().c_str()); return ERestoreState::UNITIALIZED; } diff --git a/fdbclient/TaskBucket.h b/fdbclient/TaskBucket.h index 33f8cbcfac..94365b9ddd 100644 --- a/fdbclient/TaskBucket.h +++ b/fdbclient/TaskBucket.h @@ -92,7 +92,7 @@ public: return defaultValue; return get(task); } - Key key; + StringRef key; }; struct ReservedTaskParams { diff --git a/fdbserver/workloads/TPCCWorkload.h b/fdbserver/workloads/TPCCWorkload.h index cc4910d6ea..182c493baf 100644 --- a/fdbserver/workloads/TPCCWorkload.h +++ b/fdbserver/workloads/TPCCWorkload.h @@ -286,7 +286,7 @@ struct GlobalState serializer(ar, CLoad, CRun, CDelta, CId, COlIID); } - Key key() const { return LiteralStringRef("GlobalState"); } + StringRef key() const { return LiteralStringRef("GlobalState"); } }; const std::vector syllables = {