mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 00:20:47 +00:00
sstable: allow for empty key_views
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -16,12 +16,15 @@ class key_view {
|
||||
bytes_view _bytes;
|
||||
public:
|
||||
key_view(bytes_view b) : _bytes(b) {}
|
||||
key_view() : _bytes() {}
|
||||
|
||||
std::vector<bytes> explode(const schema& s) const;
|
||||
|
||||
bool operator==(const key_view& k) const { return k._bytes == _bytes; }
|
||||
bool operator!=(const key_view& k) const { return !(k == *this); }
|
||||
|
||||
bool empty() { return _bytes.empty(); }
|
||||
|
||||
explicit operator bytes_view() const {
|
||||
return _bytes;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
|
||||
mp_row_consumer(const key& key, const schema_ptr _schema)
|
||||
: _schema(_schema)
|
||||
, _key(key)
|
||||
, _key(key_view(key))
|
||||
, mut(partition_key::from_exploded(*_schema, key.explode(*_schema)), _schema)
|
||||
{ }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user