coryan commented on a change in pull request #11890:
URL: https://github.com/apache/arrow/pull/11890#discussion_r765923061
##########
File path: cpp/src/arrow/filesystem/gcsfs.cc
##########
@@ -342,6 +345,76 @@ class GcsFileSystem::Impl {
return internal::ToArrowStatus(CreateDirMarkerRecursive(p.bucket,
p.object));
}
+ Status DeleteDir(const GcsPath& p) {
+ RETURN_NOT_OK(DeleteDirContents(p));
+ if (!p.object.empty()) {
+ return internal::ToArrowStatus(client_.DeleteObject(p.bucket, p.object));
+ }
+ return internal::ToArrowStatus(client_.DeleteBucket(p.bucket));
+ }
+
+ Status DeleteDirContents(const GcsPath& p) {
+ // Deleting large directories can be fairly slow, we need to parallelize
the
+ // operation. This uses `std::async()` to run multiple delete operations
in parallel.
Review comment:
Done, thanks!
##########
File path: cpp/src/arrow/filesystem/gcsfs.h
##########
@@ -37,6 +37,9 @@ struct ARROW_EXPORT GcsOptions {
std::string endpoint_override;
std::string scheme;
+ /// Limits the number of concurrent operations, such as Object deletes.
+ int maximum_concurrent_operations = 64;
Review comment:
Removed.
--
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]