MCPcopy Create free account
hub / github.com/apache/arrow / DeleteDirContents

Method DeleteDirContents

cpp/src/arrow/filesystem/azurefs.cc:3422–3443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3420}
3421
3422Status AzureFileSystem::DeleteDirContents(const std::string& path, bool missing_dir_ok) {
3423 ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
3424 if (location.container.empty()) {
3425 return internal::InvalidDeleteDirContents(location.all);
3426 }
3427
3428 auto adlfs_client = impl_->GetFileSystemClient(location.container);
3429 ARROW_ASSIGN_OR_RAISE(auto hns_support,
3430 impl_->HierarchicalNamespaceSupport(adlfs_client));
3431 if (hns_support == HNSSupport::kContainerNotFound) {
3432 return missing_dir_ok ? Status::OK() : PathNotFound(location);
3433 }
3434
3435 if (hns_support == HNSSupport::kEnabled) {
3436 return impl_->DeleteDirContentsOnFileSystem(adlfs_client, location, missing_dir_ok);
3437 }
3438 auto container_client = impl_->GetBlobContainerClient(location.container);
3439 return impl_->DeleteDirContentsOnContainer(container_client, location,
3440 /*require_dir_to_exist=*/!missing_dir_ok,
3441 /*preserve_dir_marker_blob=*/true,
3442 "DeleteDirContents");
3443}
3444
3445Status AzureFileSystem::DeleteRootDirContents() {
3446 return Status::NotImplemented("Cannot delete all Azure Blob Storage containers");

Callers

nothing calls this directly

Calls 8

InvalidDeleteDirContentsFunction · 0.85
GetFileSystemClientMethod · 0.80
PathNotFoundFunction · 0.70
OKFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected