6 #ifndef KAGOME_ROCKSDB_UTIL_HPP 7 #define KAGOME_ROCKSDB_UTIL_HPP 9 #include <rocksdb/status.h> 21 SL_ERROR(log,
":{}", s.ToString());
25 if (s.IsInvalidArgument()) {
29 if (s.IsCorruption()) {
33 if (s.IsNotSupported()) {
42 const auto *ptr =
reinterpret_cast<const char *
>(buf.data());
43 size_t n = buf.size();
44 return rocksdb::Slice{ptr, n};
47 inline gsl::span<const uint8_t>
make_span(
const rocksdb::Slice &s) {
49 const auto *ptr =
reinterpret_cast<const uint8_t *
>(s.data());
55 const auto *ptr =
reinterpret_cast<const uint8_t *
>(s.data());
61 #endif // KAGOME_ROCKSDB_UTIL_HPP Class represents arbitrary (including empty) byte buffer.
DatabaseError
universal database interface error
DatabaseError status_as_error(const rocksdb::Status &s)
gsl::span< const uint8_t > make_span(const rocksdb::Slice &s)
rocksdb::Slice make_slice(const common::BufferView &buf)
std::shared_ptr< soralog::Logger > Logger
common::Buffer make_buffer(const rocksdb::Slice &s)
Logger createLogger(const std::string &tag)