sstables.hh: Add attribute description API to file extension

This commit is contained in:
Calle Wilund
2019-07-15 07:51:55 +00:00
parent 4c67d702c2
commit d15c63627c

View File

@@ -33,6 +33,7 @@
#include <seastar/core/distributed.hh>
#include <unordered_set>
#include <unordered_map>
#include <variant>
#include "types.hh"
#include "clustering_key_filter.hh"
#include <seastar/core/enum.hh>
@@ -948,6 +949,15 @@ class file_io_extension {
public:
virtual ~file_io_extension() {}
virtual future<file> wrap_file(sstable&, component_type, file, open_flags flags) = 0;
// optionally return a map of attributes for a given sstable,
// suitable for "describe".
// This would preferably be interesting info on what/why the extension did
// to this table.
using attr_value_type = std::variant<sstring, std::map<sstring, sstring>>;
using attr_value_map = std::map<sstring, attr_value_type>;
virtual attr_value_map get_attributes(const sstable&) const {
return {};
}
};
}