|
10 | 10 | #include "absl/container/flat_hash_map.h"
|
11 | 11 | #include "absl/strings/numbers.h"
|
12 | 12 | #include "absl/strings/str_split.h"
|
| 13 | +#include "bytes/bytes.h" |
13 | 14 | #include "bytes/iobuf.h"
|
14 | 15 | #include "bytes/iobuf_parser.h"
|
15 | 16 | #include "model/compression.h"
|
|
24 | 25 | #include "serde/rw/sstring.h"
|
25 | 26 | #include "serde/serde_exception.h"
|
26 | 27 | #include "strings/string_switch.h"
|
| 28 | +#include "utils/base64.h" |
27 | 29 | #include "utils/to_string.h"
|
28 | 30 |
|
29 | 31 | #include <seastar/core/print.hh>
|
@@ -783,6 +785,11 @@ std::istream& operator>>(std::istream& is, fips_mode_flag& f) {
|
783 | 785 | return is;
|
784 | 786 | }
|
785 | 787 |
|
| 788 | +std::ostream& operator<<(std::ostream& os, const topic_id& id) { |
| 789 | + fmt::print(os, "{}", id); |
| 790 | + return os; |
| 791 | +} |
| 792 | + |
786 | 793 | topic_id_partition topic_id_partition::from(std::string_view s) {
|
787 | 794 | std::vector<ss::sstring> ss = absl::StrSplit(s, "/");
|
788 | 795 | if (ss.size() != 2) {
|
@@ -836,3 +843,10 @@ std::istream& operator>>(std::istream& i, kafka_batch_validation_mode& mode) {
|
836 | 843 | }
|
837 | 844 |
|
838 | 845 | } // namespace model
|
| 846 | + |
| 847 | +auto fmt::formatter<model::topic_id>::format( |
| 848 | + const model::topic_id& s, fmt::format_context& ctx) const |
| 849 | + -> decltype(ctx.out()) { |
| 850 | + bytes_view bv(s().uuid().begin(), s().uuid().size()); |
| 851 | + return fmt::format_to(ctx.out(), "{}", bytes_to_base64(bv)); |
| 852 | +} |
0 commit comments