mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 04:56:58 +00:00
This patch adds compressed_file_input_stream, which is a "random_access_reader" subclass just like the existing file_input_stream. Changed all the parsers to take a reference to random_access_reader (the base class) instead of file_input_stream. The code is now ready (sort of) for compressed-file reading, but it doesn't actually do that: sstable::read_simple() still always uses file_input_stream for now. Note: despite all the layers of classes holding our input streams, we actually pay surprisingly little cost for virtual function calls or pointer dereferencing: random_access_reader::read_exactly is *not* a virtual function - it always calls _in.read_exactly(). This is input_stream::read_exactly(), which again is not a virtual function (the rarely called get() is a virtual function is virtual, but input_stream::read_exactly() usually just reads reads from an already available buffer. Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>