@@ -39,7 +39,7 @@ uint16_t unit_test_httpd_port_number() { return 4442; }
3939namespace {
4040
4141using expectation_map_t
42- = std::map <ss::sstring, s3_imposter_fixture::expectation>;
42+ = absl::btree_map <ss::sstring, s3_imposter_fixture::expectation>;
4343
4444// Takes the input map of keys to expectations and returns a stringified XML
4545// corresponding to the appropriate S3 response.
@@ -49,7 +49,7 @@ ss::sstring list_objects_resp(
4949 ss::sstring delimiter,
5050 std::optional<size_t > max_keys_opt,
5151 std::optional<ss::sstring> continuation_token_opt) {
52- std::map <ss::sstring, size_t > content_key_to_size;
52+ absl::btree_map <ss::sstring, size_t > content_key_to_size;
5353 std::set<ss::sstring> common_prefixes;
5454 // Filter by prefix and group by the substring between the prefix and first
5555 // delimiter.
@@ -165,7 +165,7 @@ uint64_t string_view_to_ul(std::string_view sv) {
165165
166166struct s3_imposter_fixture ::content_handler {
167167 content_handler (
168- const std::vector <s3_imposter_fixture::expectation>& exp,
168+ const chunked_vector <s3_imposter_fixture::expectation>& exp,
169169 s3_imposter_fixture& imp,
170170 std::optional<absl::flat_hash_set<ss::sstring>> headers_to_store
171171 = std::nullopt )
@@ -176,13 +176,13 @@ struct s3_imposter_fixture::content_handler {
176176 }
177177 }
178178
179- void insert (const std::vector <s3_imposter_fixture::expectation>& list) {
179+ void insert (const chunked_vector <s3_imposter_fixture::expectation>& list) {
180180 for (const auto & exp : list) {
181181 expectations.insert (std::make_pair (exp.url , exp));
182182 }
183183 }
184184
185- void remove (const std::vector <ss::sstring>& urls) {
185+ void remove (const chunked_vector <ss::sstring>& urls) {
186186 for (const auto & u : urls) {
187187 expectations.erase (u);
188188 }
@@ -474,15 +474,14 @@ uint16_t s3_imposter_fixture::httpd_port_number() {
474474 return unit_test_httpd_port_number ();
475475}
476476
477- const std::vector <http_test_utils::request_info>&
477+ const chunked_vector <http_test_utils::request_info>&
478478s3_imposter_fixture::get_requests () const {
479479 return _requests;
480480}
481481
482- std::vector <http_test_utils::request_info> s3_imposter_fixture::get_requests (
482+ chunked_vector <http_test_utils::request_info> s3_imposter_fixture::get_requests (
483483 s3_imposter_fixture::req_pred_t predicate) const {
484- std::vector<http_test_utils::request_info> matching_requests;
485- matching_requests.reserve (_requests.size ());
484+ chunked_vector<http_test_utils::request_info> matching_requests;
486485 std::copy_if (
487486 _requests.cbegin (),
488487 _requests.cend (),
@@ -491,13 +490,13 @@ std::vector<http_test_utils::request_info> s3_imposter_fixture::get_requests(
491490 return matching_requests;
492491}
493492
494- const std::multimap <ss::sstring, http_test_utils::request_info>&
493+ const absl::btree_multimap <ss::sstring, http_test_utils::request_info>&
495494s3_imposter_fixture::get_targets () const {
496495 return _targets;
497496}
498497
499498void s3_imposter_fixture::set_expectations_and_listen (
500- std::vector <s3_imposter_fixture::expectation> expectations,
499+ chunked_vector <s3_imposter_fixture::expectation> expectations,
501500 std::optional<absl::flat_hash_set<ss::sstring>> headers_to_store,
502501 std::set<ss::sstring> content_type_overrides) {
503502 const ss::sstring url_prefix = " /" + url_base ();
@@ -522,7 +521,7 @@ void s3_imposter_fixture::set_expectations_and_listen(
522521}
523522
524523void s3_imposter_fixture::add_expectations (
525- std::vector <s3_imposter_fixture::expectation> expectations) {
524+ chunked_vector <s3_imposter_fixture::expectation> expectations) {
526525 vassert (_content_handler != nullptr , " Imposter is not initialized" );
527526 const ss::sstring url_prefix = " /" + url_base ();
528527 for (auto & expectation : expectations) {
@@ -532,7 +531,8 @@ void s3_imposter_fixture::add_expectations(
532531 _content_handler->insert (expectations);
533532}
534533
535- void s3_imposter_fixture::remove_expectations (std::vector<ss::sstring> urls) {
534+ void s3_imposter_fixture::remove_expectations (
535+ chunked_vector<ss::sstring> urls) {
536536 vassert (_content_handler != nullptr , " Imposter is not initialized" );
537537 const ss::sstring url_prefix = " /" + url_base ();
538538 for (auto & url : urls) {
@@ -561,7 +561,7 @@ ss::sstring s3_imposter_fixture::url_base() const {
561561
562562void s3_imposter_fixture::set_routes (
563563 ss::httpd::routes& r,
564- const std::vector <s3_imposter_fixture::expectation>& expectations,
564+ const chunked_vector <s3_imposter_fixture::expectation>& expectations,
565565 std::optional<absl::flat_hash_set<ss::sstring>> headers_to_store,
566566 std::set<ss::sstring> content_type_overrides) {
567567 using namespace ss ::httpd;
@@ -626,9 +626,9 @@ cloud_storage_clients::http_byte_range parse_byte_header(std::string_view s) {
626626 string_view_to_ul (bytes_value.substr (split_at + 1 )));
627627}
628628
629- std::vector <cloud_storage_clients::object_key>
629+ chunked_vector <cloud_storage_clients::object_key>
630630keys_from_delete_objects_request (const http_test_utils::request_info& req) {
631- std::vector <cloud_storage_clients::object_key> keys;
631+ chunked_vector <cloud_storage_clients::object_key> keys;
632632
633633 auto buffer_stream = std::istringstream{std::string{req.content }};
634634 boost::property_tree::ptree tree;
@@ -643,9 +643,10 @@ keys_from_delete_objects_request(const http_test_utils::request_info& req) {
643643 return keys;
644644}
645645
646- std::vector <std::pair<ss::sstring, cloud_storage_clients::object_key>>
646+ chunked_vector <std::pair<ss::sstring, cloud_storage_clients::object_key>>
647647keys_from_batch_delete_request (const http_test_utils::request_info& req) {
648- std::vector<std::pair<ss::sstring, cloud_storage_clients::object_key>> keys;
648+ chunked_vector<std::pair<ss::sstring, cloud_storage_clients::object_key>>
649+ keys;
649650 auto buffer_stream = std::istringstream{std::string{req.content }};
650651
651652 // crudely iterate over request lines, stripping out object keys
0 commit comments