sstables: use a key_view instead of a key in the converter

Now we can explode key_views, let's use it instead of a key.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
This commit is contained in:
Glauber Costa
2015-05-19 22:34:38 -04:00
parent e69411cf32
commit 7ebfc7ef99

View File

@@ -83,7 +83,7 @@ static inline bytes pop_back(std::vector<bytes>& vec) {
class mp_row_consumer : public row_consumer {
schema_ptr _schema;
key _key;
key_view _key;
struct column {
bool is_static;
@@ -235,9 +235,8 @@ public:
}
virtual void consume_row_start(sstables::key_view key, sstables::deletion_time deltime) override {
key_view k(_key);
if (key != k) {
throw malformed_sstable_exception(sprint("Key mismatch. Got %s while processing %s", to_hex(bytes_view(key)).c_str(), to_hex(bytes_view(k)).c_str()));
if (key != _key) {
throw malformed_sstable_exception(sprint("Key mismatch. Got %s while processing %s", to_hex(bytes_view(key)).c_str(), to_hex(bytes_view(_key)).c_str()));
}
if (!deltime.live()) {