0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 14:31:11 +01:00

ircd::db: Remove the cache prefetch/fetch interface.

This commit is contained in:
Jason Volk 2018-09-01 03:56:11 -07:00
parent 13c9e5bf6f
commit ff7d2514a0
2 changed files with 0 additions and 55 deletions

View file

@ -57,12 +57,4 @@ namespace ircd::db
// Clear the cache (won't clear entries which are actively referenced)
void clear(rocksdb::Cache &);
void clear(rocksdb::Cache *const &);
// Read the key from disk into cache; yields when done; returns exists.
bool fetch(rocksdb::Cache &, column &, const string_view &key);
bool fetch(rocksdb::Cache *const &, column &, const string_view &key);
// Read the key from disk into cache asynchronously; returns immediately.
void prefetch(rocksdb::Cache &, column &, const string_view &key);
void prefetch(rocksdb::Cache *const &, column &, const string_view &key);
}

View file

@ -7749,53 +7749,6 @@ ircd::db::_seek_(rocksdb::Iterator &it,
// cache.h
//
void
ircd::db::prefetch(rocksdb::Cache *const &cache,
column &column,
const string_view &key)
{
if(cache)
return prefetch(*cache, column, key);
}
void
ircd::db::prefetch(rocksdb::Cache &cache,
column &column,
const string_view &key)
{
assert(0);
}
bool
ircd::db::fetch(rocksdb::Cache *const &cache,
column &column,
const string_view &key)
{
return cache? fetch(*cache, column, key) : false;
}
bool
ircd::db::fetch(rocksdb::Cache &cache,
column &column,
const string_view &key)
{
const db::gopts opts
{
// skip rocksdb inserting this into the columns cache twice.
&cache == db::cache(column) || &cache == db::cache_compressed(column)?
db::get::NO_CACHE:
(enum db::get)0
};
const auto closure{[&cache, &key]
(const string_view &value)
{
insert(cache, key, value);
}};
return column(key, std::nothrow, closure, opts);
}
void
ircd::db::clear(rocksdb::Cache *const &cache)
{