Skip to content

Commit da3ec9c

Browse files
apolukhinrobot-piglet
authored andcommitted
feat rocksdb: fix build on new versions of RocksDB
Tests: протестировано CI --- Pull Request resolved: #1171 commit_hash:3739a114471e7591ad429d348aeddcd84236b867
1 parent 8bad200 commit da3ec9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rocks/src/storages/rocks/client.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <userver/storages/rocks/client.hpp>
22

3+
#include <rocksdb/version.h>
4+
35
#include <fmt/format.h>
46

57
#include <userver/storages/rocks/exception.hpp>
@@ -15,9 +17,13 @@ Client::Client(const std::string& db_path, engine::TaskProcessor& blocking_task_
1517
rocksdb::Options options;
1618
options.create_if_missing = true;
1719

20+
#if ROCKSDB_MAJOR > 9
21+
const rocksdb::Status status = rocksdb::DB::Open(options, db_path, &db_);
22+
#else
1823
rocksdb::DB* db{};
1924
const rocksdb::Status status = rocksdb::DB::Open(options, db_path, &db);
2025
db_.reset(db);
26+
#endif
2127
CheckStatus(status, "Create client");
2228
}
2329

0 commit comments

Comments
 (0)