felipecrv commented on code in PR #39904:
URL: https://github.com/apache/arrow/pull/39904#discussion_r1483800362
##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -1115,6 +1332,22 @@ class AzureFileSystem::Impl {
}
}
+ Result<FileInfo> GetFileInfoOfPathWithinContainer(const AzureLocation&
location) {
Review Comment:
This function is for when the `AzureLocation` is tested to contain a `path`.
`AzureFileSystem::GetFileInfo` (pasted below) is defined in terms of
`GetContainerPropsAsFileInfo` and `GetFileInfoOfPathWithinContainer` -- which
is great because inside `AzureFileSystem::Impl` I should be making calls to
these functions that don't have to do a lot of extra argument checks before
deciding what to do.
```cpp
Result<FileInfo> AzureFileSystem::GetFileInfo(const std::string& path) {
ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
if (location.container.empty()) {
DCHECK(location.path.empty());
// Root directory of the storage account.
return FileInfo{"", FileType::Directory};
}
if (location.path.empty()) {
// We have a container, but no path within the container.
// The container itself represents a directory.
auto container_client =
impl_->GetBlobContainerClient(location.container);
return GetContainerPropsAsFileInfo(location, container_client);
}
return impl_->GetFileInfoOfPathWithinContainer(location);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]