mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
sstable: convenient view for types
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -18,6 +18,9 @@ namespace sstables {
|
||||
template <typename Size>
|
||||
struct disk_string {
|
||||
bytes value;
|
||||
explicit operator bytes_view() const {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Size, typename Members>
|
||||
@@ -51,12 +54,20 @@ struct index_entry {
|
||||
disk_string<uint16_t> key;
|
||||
uint64_t position;
|
||||
disk_string<uint32_t> promoted_index;
|
||||
|
||||
explicit operator bytes_view() const {
|
||||
return bytes_view(key);
|
||||
}
|
||||
};
|
||||
|
||||
struct summary_entry {
|
||||
bytes key;
|
||||
uint64_t position;
|
||||
|
||||
explicit operator bytes_view() const {
|
||||
return key;
|
||||
}
|
||||
|
||||
bool operator==(const summary_entry& x) const {
|
||||
return position == x.position && key == x.key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user