@@ -40,7 +40,7 @@ struct S3Key {
40
40
// The MockS3Client can simulate storage failures by using the get_failure_trigger for s3_object_names.
41
41
class MockS3Client : public S3ClientInterface {
42
42
public:
43
- MockS3Client (){}
43
+ MockS3Client () {}
44
44
45
45
// Can be used to trigger a simulated failure inside MockS3Client. For example:
46
46
// auto object_to_trigger_put_failure = get_failure_trigger("test", StorageOperation::WRITE, Aws::S3::S3Errors::NETWORK_FAILURE, false);
@@ -49,28 +49,36 @@ class MockS3Client : public S3ClientInterface {
49
49
// The returned name looks like "{s3_object_name}#Failure_{operation_to_fail}_{error_to_fail_with}_{retryable}".
50
50
// For example: "symbol_1#Failure_Delete_99_1" will trigger a delete failure with code 99 which is retryable.
51
51
static std::string get_failure_trigger (
52
- const std::string& s3_object_name,
53
- StorageOperation operation_to_fail,
54
- Aws::S3::S3Errors error_to_fail_with,
55
- bool retryable= true );
52
+ const std::string& s3_object_name,
53
+ StorageOperation operation_to_fail,
54
+ Aws::S3::S3Errors error_to_fail_with,
55
+ bool retryable = true );
56
56
57
- [[nodiscard]] S3Result<std::monostate> head_object (const std::string& s3_object_name, const std::string& bucket_name) const override ;
57
+ [[nodiscard]] S3Result<std::monostate> head_object (
58
+ const std::string& s3_object_name,
59
+ const std::string& bucket_name) const override ;
58
60
59
- [[nodiscard]] S3Result<Segment> get_object (const std::string& s3_object_name, const std::string& bucket_name) const override ;
61
+ [[nodiscard]] S3Result<Segment> get_object (
62
+ const std::string& s3_object_name,
63
+ const std::string& bucket_name) const override ;
64
+
65
+ [[nodiscard]] folly::Future<S3Result<Segment>> get_object_async (
66
+ const std::string& s3_object_name,
67
+ const std::string& bucket_name) const override ;
60
68
61
69
S3Result<std::monostate> put_object (
62
- const std::string& s3_object_name,
63
- Segment&& segment,
64
- const std::string& bucket_name) override ;
70
+ const std::string& s3_object_name,
71
+ Segment&& segment,
72
+ const std::string& bucket_name) override ;
65
73
66
74
S3Result<DeleteOutput> delete_objects (
67
- const std::vector<std::string>& s3_object_names,
68
- const std::string& bucket_name) override ;
75
+ const std::vector<std::string>& s3_object_names,
76
+ const std::string& bucket_name) override ;
69
77
70
78
S3Result<ListObjectsOutput> list_objects (
71
- const std::string& prefix,
72
- const std::string& bucket_name,
73
- const std::optional<std::string>& continuation_token) const override ;
79
+ const std::string& prefix,
80
+ const std::string& bucket_name,
81
+ const std::optional<std::string>& continuation_token) const override ;
74
82
75
83
private:
76
84
std::map<S3Key, Segment> s3_contents;
0 commit comments