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

Method deleteContainer

fdbclient/BackupContainerLocalDirectory.actor.cpp:294–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294Future<Void> BackupContainerLocalDirectory::deleteContainer(int* pNumDeleted) {
295 // In order to avoid deleting some random directory due to user error, first describe the backup
296 // and make sure it has something in it.
297 return map(describeBackup(false, invalidVersion), [=](BackupDescription const& desc) {
298 // If the backup has no snapshots and no logs then it's probably not a valid backup
299 if (desc.snapshots.size() == 0 && !desc.minLogBegin.present())
300 throw backup_invalid_url();
301
302 int count = platform::eraseDirectoryRecursive(m_path);
303 if (pNumDeleted != nullptr)
304 *pNumDeleted = count;
305
306 return Void();
307 });
308}

Callers

nothing calls this directly

Calls 5

mapFunction · 0.85
eraseDirectoryRecursiveFunction · 0.85
VoidClass · 0.50
sizeMethod · 0.45
presentMethod · 0.45

Tested by

no test coverage detected