mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
sstables: add static method filename to sstable
This function is likely to be duplicated over time, so let's make it available as a static method of sstable class. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
@@ -1112,6 +1112,16 @@ const sstring sstable::filename(component_type f) {
|
||||
return _dir + "/" + version + "-" + generation + "-" + format + "-" + component;
|
||||
}
|
||||
|
||||
const sstring sstable::filename(sstring dir, version_types version, unsigned long generation,
|
||||
format_types format, component_type component) {
|
||||
auto& v = _version_string.at(version);
|
||||
auto& f = _format_string.at(format);
|
||||
auto& c= _component_map.at(component);
|
||||
auto g = to_sstring(generation);
|
||||
|
||||
return dir + "/" + v + "-" + g + "-" + f + "-" + c;
|
||||
}
|
||||
|
||||
sstable::version_types sstable::version_from_sstring(sstring &s) {
|
||||
return reverse_map(s, _version_string);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ public:
|
||||
|
||||
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,
|
||||
format_types format, component_type component);
|
||||
|
||||
future<> load();
|
||||
future<> store();
|
||||
|
||||
Reference in New Issue
Block a user