Skip to content

Commit

Permalink
cst: Add ostream operator for chunk state
Browse files Browse the repository at this point in the history
(cherry picked from commit 963a5d3)
  • Loading branch information
abhijat committed Apr 11, 2024
1 parent b5c3804 commit e366458
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/v/cloud_storage/segment_chunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@

namespace cloud_storage {

std::ostream& operator<<(std::ostream& os, chunk_state c) {
switch (c) {
case chunk_state::not_available:
return os << "not available";
case chunk_state::download_in_progress:
return os << "download in progress";
case chunk_state::hydrated:
return os << "hydrated";
}
}

std::strong_ordering
segment_chunk::operator<=>(const segment_chunk& chunk) const {
const auto cmp = required_by_readers_in_future
Expand Down
2 changes: 2 additions & 0 deletions src/v/cloud_storage/segment_chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ enum class chunk_state {
hydrated,
};

std::ostream& operator<<(std::ostream& os, chunk_state);

struct segment_chunk {
chunk_state current_state;

Expand Down

0 comments on commit e366458

Please sign in to comment.