Skip to content

Commit

Permalink
Fix missing overload variable in Rocksdb ivf demo (facebookresearch#3326
Browse files Browse the repository at this point in the history
)

Summary:
**Bugs:**
When following rocksdb_ivf demo to build executable file, its output as:
```bash
faiss/demos/rocksdb_ivf/RocksDBInvertedLists.h:52:35: error: 'faiss::InvertedListsIterator* faiss_rocksdb::RocksDBInvertedLists::get_iterator(size_t) const' marked 'override', but does not override
   52 |     faiss::InvertedListsIterator* get_iterator(size_t list_no) const override;
      |                                   ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/demo_rocksdb_ivf.dir/build.make:90: CMakeFiles/demo_rocksdb_ivf.dir/RocksDBInvertedLists.cpp.o] Error 1
```

**Solution:**
Add relevant variable `void* inverted_list_contex` corresponding `get_iterator`'s base virtual function.

Pull Request resolved: facebookresearch#3326

Reviewed By: mlomeli1, mdouze

Differential Revision: D55629580

Pulled By: algoriddle

fbshipit-source-id: a12fcacb483e0dd576411ad91a3dd1e0de94abec
  • Loading branch information
Warmchay authored and facebook-github-bot committed Apr 2, 2024
1 parent 77e2e79 commit c9c86f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion demos/rocksdb_ivf/RocksDBInvertedLists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ void RocksDBInvertedLists::resize(size_t /*list_no*/, size_t /*new_size*/) {
}

InvertedListsIterator* RocksDBInvertedLists::get_iterator(
size_t list_no) const {
size_t list_no,
void* inverted_list_context) const {
return new RocksDBInvertedListsIterator(db_.get(), list_no, code_size);
}

Expand Down
4 changes: 3 additions & 1 deletion demos/rocksdb_ivf/RocksDBInvertedLists.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ struct RocksDBInvertedLists : faiss::InvertedLists {

void resize(size_t list_no, size_t new_size) override;

faiss::InvertedListsIterator* get_iterator(size_t list_no) const override;
faiss::InvertedListsIterator* get_iterator(
size_t list_no,
void* inverted_list_context) const override;

private:
std::unique_ptr<rocksdb::DB> db_;
Expand Down

0 comments on commit c9c86f0

Please sign in to comment.