mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 01:50:35 +00:00
Previously we had both a "compression" structure (read from the Compression Info file on disk) and a "compression_metadata" class with additional information, which std::move()ed parts of the compression structure. This caused problems for the simplistic sstable-writing test (which does the non-interesting thing of writing a previously-read sstable). I'm ashamed to say, fixing this was very hard, because all this code is built like a house of cards - try to change one thing, and everything falls apart. After many failed attempts in trying to improve this code, what I ended up doing is simply *extending* the "compression" structure - the extended part isn't read or written, but it is in the structure. We also no longer move a shared pointer to the compression structure, but rather just an ordinary pointer; The assumption is that the user will already make sure that the sstable structure will live for the durations of any processing on it - and the compression structure is just one part of this sstable structure. Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>