mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd::db: API fixes for RocksDB v6.22+.
This commit is contained in:
parent
f1051cf56b
commit
7cd34cba0a
3 changed files with 40 additions and 0 deletions
|
@ -224,6 +224,13 @@ ircd::db::database::cache final
|
|||
#ifdef IRCD_DB_HAS_CACHE_GETCHARGE
|
||||
size_t GetCharge(Handle *) const noexcept override;
|
||||
#endif
|
||||
#ifdef IRCD_DB_HAS_CACHE_GETDELETER
|
||||
DeleterFn GetDeleter(Handle *) const noexcept override;
|
||||
#endif
|
||||
#ifdef IRCD_DB_HAS_CACHE_APPLYTOALL
|
||||
using callbackstd = std::function<void (const Slice &, void *, size_t, DeleterFn)>;
|
||||
void ApplyToAllEntries(const callbackstd &, const ApplyToAllEntriesOptions &) noexcept override;
|
||||
#endif
|
||||
|
||||
cache(database *const &,
|
||||
std::shared_ptr<struct database::stats>,
|
||||
|
|
|
@ -3241,6 +3241,27 @@ const noexcept
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef IRCD_DB_HAS_CACHE_GETDELETER
|
||||
rocksdb::Cache::DeleterFn
|
||||
ircd::db::database::cache::GetDeleter(Handle *const h)
|
||||
const noexcept
|
||||
{
|
||||
assert(bool(c));
|
||||
return c->GetDeleter(h);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IRCD_DB_HAS_CACHE_APPLYTOALL
|
||||
void
|
||||
ircd::db::database::cache::ApplyToAllEntries(const callbackstd &cb,
|
||||
const ApplyToAllEntriesOptions &opts)
|
||||
noexcept
|
||||
{
|
||||
assert(bool(c));
|
||||
return c->ApplyToAllEntries(cb, opts);
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// database::compaction_filter
|
||||
|
|
|
@ -72,3 +72,15 @@
|
|||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 10 && ROCKSDB_PATCH >= 0)
|
||||
#define IRCD_DB_HAS_MULTIGET_DIRECT
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 22) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 22 && ROCKSDB_PATCH >= 1)
|
||||
#define IRCD_DB_HAS_CACHE_GETDELETER
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 22) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 22 && ROCKSDB_PATCH >= 1)
|
||||
#define IRCD_DB_HAS_CACHE_APPLYTOALL
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue