Skip to content

Commit

Permalink
cloud_storage: operator<< for find_topic_manifest_outcome
Browse files Browse the repository at this point in the history
Defines an operator<< for the outcome classA subsequent commit will log
download outcomes.
  • Loading branch information
andrwng committed Jul 8, 2024
1 parent cb28b6a commit e1df87e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/v/cloud_storage/topic_manifest_downloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ bool bin_manifest_filter(
return i.key.ends_with("topic_manifest.bin");
};
} // namespace

std::ostream& operator<<(std::ostream& os, find_topic_manifest_outcome o) {
switch (o) {
case find_topic_manifest_outcome::success:
os << "find_topic_manifest_outcome::success";
break;
case find_topic_manifest_outcome::no_matching_manifest:
os << "find_topic_manifest_outcome::no_matching_manifest";
break;
case find_topic_manifest_outcome::multiple_matching_manifests:
os << "find_topic_manifest_outcome::multiple_matching_manifests";
break;
}
return os;
}

topic_manifest_downloader::topic_manifest_downloader(
const cloud_storage_clients::bucket_name bucket,
std::optional<ss::sstring> hint,
Expand Down
1 change: 1 addition & 0 deletions src/v/cloud_storage/topic_manifest_downloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum class find_topic_manifest_outcome {
// and a hint must be provided to determine winner.
multiple_matching_manifests,
};
std::ostream& operator<<(std::ostream&, find_topic_manifest_outcome);

// Encapsulates downloading manifests for a given topic.
//
Expand Down

0 comments on commit e1df87e

Please sign in to comment.