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

Method DeleteDir

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

Source from the content-addressed store, hash-verified

3392}
3393
3394Status AzureFileSystem::DeleteDir(const std::string& path) {
3395 ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
3396 if (location.container.empty()) {
3397 return Status::Invalid("DeleteDir requires a non-empty path.");
3398 }
3399 if (location.path.empty()) {
3400 auto container_client = impl_->GetBlobContainerClient(location.container);
3401 return impl_->DeleteContainer(container_client, location);
3402 }
3403
3404 auto adlfs_client = impl_->GetFileSystemClient(location.container);
3405 ARROW_ASSIGN_OR_RAISE(auto hns_support,
3406 impl_->HierarchicalNamespaceSupport(adlfs_client));
3407 if (hns_support == HNSSupport::kContainerNotFound) {
3408 return PathNotFound(location);
3409 }
3410 if (hns_support == HNSSupport::kEnabled) {
3411 return impl_->DeleteDirOnFileSystem(adlfs_client, location, /*recursive=*/true,
3412 /*require_dir_to_exist=*/true);
3413 }
3414 DCHECK_EQ(hns_support, HNSSupport::kDisabled);
3415 auto container_client = impl_->GetBlobContainerClient(location.container);
3416 return impl_->DeleteDirContentsOnContainer(container_client, location,
3417 /*require_dir_to_exist=*/true,
3418 /*preserve_dir_marker_blob=*/false,
3419 "DeleteDir");
3420}
3421
3422Status AzureFileSystem::DeleteDirContents(const std::string& path, bool missing_dir_ok) {
3423 ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));

Callers

nothing calls this directly

Calls 8

DeleteContainerMethod · 0.80
GetFileSystemClientMethod · 0.80
DeleteDirOnFileSystemMethod · 0.80
PathNotFoundFunction · 0.70
InvalidFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected