MCPcopy Create free account
hub / github.com/apple/foundationdb / openBackupContainer

Function openBackupContainer

fdbbackup/backup.actor.cpp:2246–2271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244}
2245
2246Reference<IBackupContainer> openBackupContainer(const char* name,
2247 const std::string& destinationContainer,
2248 const Optional<std::string>& proxy,
2249 const Optional<std::string>& encryptionKeyFile) {
2250 // Error, if no dest container was specified
2251 if (destinationContainer.empty()) {
2252 fprintf(stderr, "ERROR: No backup destination was specified.\n");
2253 printHelpTeaser(name);
2254 throw backup_error();
2255 }
2256
2257 Reference<IBackupContainer> c;
2258 try {
2259 c = IBackupContainer::openContainer(destinationContainer, proxy, encryptionKeyFile);
2260 } catch (Error& e) {
2261 std::string msg = format("ERROR: '%s' on URL '%s'", e.what(), destinationContainer.c_str());
2262 if (e.code() == error_code_backup_invalid_url && !IBackupContainer::lastOpenError.empty()) {
2263 msg += format(": %s", IBackupContainer::lastOpenError.c_str());
2264 }
2265 fprintf(stderr, "%s\n", msg.c_str());
2266 printHelpTeaser(name);
2267 throw;
2268 }
2269
2270 return c;
2271}
2272
2273// Submit the restore request to the database if "performRestore" is true. Otherwise,
2274// check if the restore can be performed.

Callers 8

Future<Void> runRestoreFunction · 0.85
Future<Void> queryBackupFunction · 0.85
mainFunction · 0.85

Calls 7

fprintfFunction · 0.85
printHelpTeaserFunction · 0.70
formatFunction · 0.50
emptyMethod · 0.45
whatMethod · 0.45
c_strMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected