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

Method DeleteContainer

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

\pre location.container is not empty. \pre location.path is empty.

Source from the content-addressed store, hash-verified

2456 /// \pre location.container is not empty.
2457 /// \pre location.path is empty.
2458 Status DeleteContainer(const Blobs::BlobContainerClient& container_client,
2459 const AzureLocation& location) {
2460 DCHECK(!location.container.empty());
2461 DCHECK(location.path.empty());
2462 try {
2463 auto response = container_client.Delete();
2464 // Only the "*IfExists" functions ever set Deleted to false.
2465 // All the others either succeed or throw an exception.
2466 DCHECK(response.Value.Deleted);
2467 } catch (const Core::RequestFailedException& exception) {
2468 if (IsContainerNotFound(exception)) {
2469 return PathNotFound(location);
2470 }
2471 return ExceptionToStatus(exception,
2472 "Failed to delete a container: ", location.container, ": ",
2473 container_client.GetUrl());
2474 }
2475 return Status::OK();
2476 }
2477
2478 /// Deletes contents of a directory and possibly the directory itself
2479 /// depending on the value of preserve_dir_marker_blob.

Callers 1

DeleteDirMethod · 0.80

Calls 6

IsContainerNotFoundFunction · 0.85
ExceptionToStatusFunction · 0.85
PathNotFoundFunction · 0.70
OKFunction · 0.50
emptyMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected