sstables: component_from_sstring

Analogous to version and format

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
Glauber Costa
2015-08-05 17:12:59 -05:00
parent 3e1fe072d4
commit 8a3c935c21
2 changed files with 5 additions and 0 deletions

View File

@@ -1389,6 +1389,10 @@ sstable::format_types sstable::format_from_sstring(sstring &s) {
return reverse_map(s, _format_string);
}
sstable::component_type sstable::component_from_sstring(sstring &s) {
return reverse_map(s, _component_map);
}
input_stream<char> sstable::data_stream_at(uint64_t pos) {
if (_compression) {
return make_compressed_file_input_stream(

View File

@@ -161,6 +161,7 @@ public:
// Like data_consume_rows() with bounds, but iterates over whole range
data_consume_context data_consume_rows(row_consumer& consumer);
static component_type component_from_sstring(sstring& s);
static version_types version_from_sstring(sstring& s);
static format_types format_from_sstring(sstring& s);
static const sstring filename(sstring dir, version_types version, unsigned long generation,