mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd::db: Add support #ifdefs for MultiGet; add fallback path.
This commit is contained in:
parent
5593ae3a60
commit
afcb22b726
2 changed files with 25 additions and 1 deletions
14
ircd/db.cc
14
ircd/db.cc
|
@ -8117,9 +8117,17 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
|||
};
|
||||
|
||||
rocksdb::Status status[num];
|
||||
#ifdef IRCD_DB_HAS_MULTIGET_BATCHED
|
||||
_seek(op, {status, num}, {val, num}, ropts);
|
||||
#else
|
||||
for(size_t i(0); i < num; ++i)
|
||||
{
|
||||
database::column &column(std::get<0>(op[i]));
|
||||
status[i] = _seek(column, val[i], std::get<1>(op[i]), ropts);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(closure) for(size_t i(0); i < op.size(); ++i)
|
||||
if(closure) for(size_t i(0); i < num; ++i)
|
||||
{
|
||||
const column::delta &delta
|
||||
{
|
||||
|
@ -8136,6 +8144,7 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef IRCD_DB_HAS_MULTIGET_BATCHED
|
||||
void
|
||||
ircd::db::_seek(const vector_view<_read_op> &op,
|
||||
const vector_view<rocksdb::Status> &ret,
|
||||
|
@ -8192,6 +8201,9 @@ ircd::db::_seek(const vector_view<_read_op> &op,
|
|||
};
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#warning "RocksDB version does not support batched MultiGet; some queries will be linearized"
|
||||
#endif IRCD_DB_HAS_MULTIGET_BATCHED
|
||||
|
||||
//
|
||||
// iterator seek suite
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
#define IRCD_DB_HAS_PERIODIC_COMPACTIONS
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 2) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 2 && ROCKSDB_PATCH >= 2)
|
||||
#define IRCD_DB_HAS_MULTIGET_SINGLE
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 3) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 3 && ROCKSDB_PATCH >= 6)
|
||||
|
@ -49,6 +55,12 @@
|
|||
#define IRCD_DB_HAS_CACHE_GETCHARGE
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 6) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 6 && ROCKSDB_PATCH >= 3)
|
||||
#define IRCD_DB_HAS_MULTIGET_BATCHED
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 7) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 7 && ROCKSDB_PATCH >= 3)
|
||||
|
|
Loading…
Reference in a new issue