mirror of
https://github.com/matrix-construct/construct
synced 2025-04-10 20:13:24 +02: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];
|
rocksdb::Status status[num];
|
||||||
|
#ifdef IRCD_DB_HAS_MULTIGET_BATCHED
|
||||||
_seek(op, {status, num}, {val, num}, ropts);
|
_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
|
const column::delta &delta
|
||||||
{
|
{
|
||||||
|
@ -8136,6 +8144,7 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef IRCD_DB_HAS_MULTIGET_BATCHED
|
||||||
void
|
void
|
||||||
ircd::db::_seek(const vector_view<_read_op> &op,
|
ircd::db::_seek(const vector_view<_read_op> &op,
|
||||||
const vector_view<rocksdb::Status> &ret,
|
const vector_view<rocksdb::Status> &ret,
|
||||||
|
@ -8192,6 +8201,9 @@ ircd::db::_seek(const vector_view<_read_op> &op,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#warning "RocksDB version does not support batched MultiGet; some queries will be linearized"
|
||||||
|
#endif IRCD_DB_HAS_MULTIGET_BATCHED
|
||||||
|
|
||||||
//
|
//
|
||||||
// iterator seek suite
|
// iterator seek suite
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
#define IRCD_DB_HAS_PERIODIC_COMPACTIONS
|
#define IRCD_DB_HAS_PERIODIC_COMPACTIONS
|
||||||
#endif
|
#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 \
|
#if ROCKSDB_MAJOR > 6 \
|
||||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 3) \
|
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 3) \
|
||||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 3 && ROCKSDB_PATCH >= 6)
|
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 3 && ROCKSDB_PATCH >= 6)
|
||||||
|
@ -49,6 +55,12 @@
|
||||||
#define IRCD_DB_HAS_CACHE_GETCHARGE
|
#define IRCD_DB_HAS_CACHE_GETCHARGE
|
||||||
#endif
|
#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 \
|
#if ROCKSDB_MAJOR > 6 \
|
||||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 7) \
|
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 7) \
|
||||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 7 && ROCKSDB_PATCH >= 3)
|
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 7 && ROCKSDB_PATCH >= 3)
|
||||||
|
|
Loading…
Add table
Reference in a new issue