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

Function GetContainerPropsAsFileInfo

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

Source from the content-addressed store, hash-verified

1490/// \pre location.container is not empty.
1491template <class ContainerClient>
1492Result<FileInfo> GetContainerPropsAsFileInfo(const AzureLocation& location,
1493 const ContainerClient& container_client) {
1494 DCHECK(!location.container.empty());
1495 FileInfo info{location.path.empty() ? location.all : location.container};
1496 try {
1497 auto properties = container_client.GetProperties();
1498 info.set_type(FileType::Directory);
1499 info.set_mtime(std::chrono::system_clock::time_point{properties.Value.LastModified});
1500 return info;
1501 } catch (const Core::RequestFailedException& exception) {
1502 if (IsContainerNotFound(exception)) {
1503 info.set_type(FileType::NotFound);
1504 return info;
1505 }
1506 return ExceptionToStatus(exception, "GetProperties for '", container_client.GetUrl(),
1507 "' failed.");
1508 }
1509}
1510
1511template <class ContainerClient>
1512Status CreateContainerIfNotExists(const std::string& container_name,

Callers 2

CheckDirExistsMethod · 0.85
GetFileInfoMethod · 0.85

Calls 4

IsContainerNotFoundFunction · 0.85
ExceptionToStatusFunction · 0.85
emptyMethod · 0.45
GetPropertiesMethod · 0.45

Tested by

no test coverage detected