diff --git a/sstables/key.cc b/sstables/key.cc index 3365991c3e..df09607b6e 100644 --- a/sstables/key.cc +++ b/sstables/key.cc @@ -127,6 +127,13 @@ composite composite::from_exploded(const std::vector& v) { return from_components(v.begin(), v.end(), std::vector(v.size(), bytes_type), true); } +composite composite::static_prefix(const schema& s) { + static bytes static_marker(size_t(2), bytes::value_type(0xff)); + + std::vector sv(s.clustering_key_size()); + return static_marker + from_components(sv.begin(), sv.end(), std::vector(sv.size(), bytes_type), true); +} + inline std::vector explode_composite(bytes_view _bytes) { std::vector ret; diff --git a/sstables/key.hh b/sstables/key.hh index e542f7078f..000bda3090 100644 --- a/sstables/key.hh +++ b/sstables/key.hh @@ -115,6 +115,7 @@ public: static composite from_bytes(bytes b) { return composite(std::move(b)); } static composite from_clustering_key(const schema& s, const clustering_key& ck); static composite from_exploded(const std::vector& v); + static composite static_prefix(const schema& s); explicit operator bytes_view() const { return _bytes; }