lidavidm commented on a change in pull request #10877:
URL: https://github.com/apache/arrow/pull/10877#discussion_r684395241



##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -483,6 +484,29 @@ std::string FormatRange(int64_t start, int64_t length) {
   return ss.str();
 }
 
+// An AWS RetryStrategy that wraps a provided arrow::fs::S3RetryStrategy
+class WrappedRetryStrategy : public Aws::Client::RetryStrategy {
+ public:
+  explicit WrappedRetryStrategy(const std::shared_ptr<S3RetryStrategy>& 
s3_retry_strategy)
+      : s3_retry_strategy_(s3_retry_strategy) {}
+
+  bool ShouldRetry(const Aws::Client::AWSError<Aws::Client::CoreErrors>& error,
+                   long attempted_retries) const override {  // NOLINT 
runtime/int
+    S3RetryStrategy::AWSErrorDetail detail = ErrorToDetail(error);
+    return s3_retry_strategy_->ShouldRetry(detail, attempted_retries);
+  }
+
+  long CalculateDelayBeforeNextRetry(  // NOLINT runtime/int
+      const Aws::Client::AWSError<Aws::Client::CoreErrors>& error,
+      long attempted_retries) const override {  // NOLINT runtime/int
+    S3RetryStrategy::AWSErrorDetail detail = ErrorToDetail(error);
+    return s3_retry_strategy_->CalculateDelayBeforeNextRetry(detail, 
attempted_retries);

Review comment:
       Ah, and one thing from CI - you'll need an explicit static_cast here to 
satisfy MSVC. 
https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/40283536/job/1xh370nnu6or1iix#L1135




-- 
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]


Reply via email to