From 16f363b2342c66eddd909be230f5de72bd8d71a5 Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Thu, 24 Jan 2019 18:00:18 -0800 Subject: [PATCH] Add fdbserver dependency to fdbbackup --- fdbbackup/backup.actor.cpp | 4 +++- fdbbackup/fdbbackup.vcxproj | 3 +++ fdbserver/Restore.actor.cpp | 8 +++++++- fdbserver/RestoreInterface.h | 5 +++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/fdbbackup/backup.actor.cpp b/fdbbackup/backup.actor.cpp index 73eb1e0435..7f7191033f 100644 --- a/fdbbackup/backup.actor.cpp +++ b/fdbbackup/backup.actor.cpp @@ -34,6 +34,8 @@ #include "fdbclient/BlobStore.h" #include "fdbclient/json_spirit/json_spirit_writer_template.h" +#include "fdbserver/RestoreInterface.h" + #include "fdbrpc/Platform.h" #include @@ -67,8 +69,8 @@ using std::endl; #include "versions.h" #endif + #include "flow/SimpleOpt.h" -#include "fdbserver/RestoreInterface.h" #include "flow/actorcompiler.h" // This must be the last #include. diff --git a/fdbbackup/fdbbackup.vcxproj b/fdbbackup/fdbbackup.vcxproj index 93db7d67c1..19b240294d 100644 --- a/fdbbackup/fdbbackup.vcxproj +++ b/fdbbackup/fdbbackup.vcxproj @@ -64,6 +64,9 @@ $(TargetDir)fdbclient.lib + + $(TargetDir)fdbserver.lib + FDB_VT_VERSION="$(Version)$(PreReleaseDecoration)";FDB_VT_PACKAGE_NAME="$(PackageName)";%(PreprocessorDefinitions) diff --git a/fdbserver/Restore.actor.cpp b/fdbserver/Restore.actor.cpp index 813dca80d7..ba5505cbc5 100644 --- a/fdbserver/Restore.actor.cpp +++ b/fdbserver/Restore.actor.cpp @@ -4341,7 +4341,7 @@ ACTOR static Future waitFastRestore(Database cx, Key tagName, boo } -ACTOR Future fastRestore(Database cx, Key tagName, Key url, bool waitForComplete, Version targetVersion, bool verbose, KeyRange range, Key addPrefix, Key removePrefix) { +ACTOR static Future _fastRestore(Database cx, Key tagName, Key url, bool waitForComplete, Version targetVersion, bool verbose, KeyRange range, Key addPrefix, Key removePrefix) { state Reference bc = IBackupContainer::openContainer(url.toString()); state BackupDescription desc = wait(bc->describeBackup()); wait(desc.resolveVersionTimes(cx)); @@ -4394,3 +4394,9 @@ ACTOR Future fastRestore(Database cx, Key tagName, Key url, bool waitFo return targetVersion; } + + +ACTOR Future fastRestore(Database cx, Standalone tagName, Standalone url, bool waitForComplete, long targetVersion, bool verbose, Standalone range, Standalone addPrefix, Standalone removePrefix) { + Version targetVersion = wait( _fastRestore(cx, tagName, url, waitForComplete, targetVersion, verbose, range, addPrefix, removePrefix) ); + return targetVersion; +} \ No newline at end of file diff --git a/fdbserver/RestoreInterface.h b/fdbserver/RestoreInterface.h index c9ef469ec5..79eba9d781 100644 --- a/fdbserver/RestoreInterface.h +++ b/fdbserver/RestoreInterface.h @@ -348,6 +348,7 @@ std::string getRoleStr(RestoreRole role); ////--- Interface functions Future _restoreWorker(Database const& cx, LocalityData const& locality); Future restoreWorker(Reference const& ccf, LocalityData const& locality); -Future fastRestore(Database const& cx, Key const& tagName, Key const& url, bool const& waitForComplete, Version const& targetVersion, bool const& verbose, KeyRange const& range, Key const& addPrefix, Key const& removePrefix); +//Future _fastRestore(Database const& cx, Key const& tagName, Key const& url, bool const& waitForComplete, Version const& targetVersion, bool const& verbose, KeyRange const& range, Key const& addPrefix, Key const& removePrefix); +Future fastRestore(Database const& cx, Standalone const& tagName, Standalone const& url, bool const& waitForComplete, long const& targetVersion, bool const& verbose, Standalone const& range, Standalone const& addPrefix, Standalone const& removePrefix); -#endif +#endif \ No newline at end of file