faiss/demos/rocksdb_ivf
Warmchay c9c86f0daa Fix missing overload variable in Rocksdb ivf demo (#3326)
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: https://github.com/facebookresearch/faiss/pull/3326

Reviewed By: mlomeli1, mdouze

Differential Revision: D55629580

Pulled By: algoriddle

fbshipit-source-id: a12fcacb483e0dd576411ad91a3dd1e0de94abec
2024-04-02 06:11:53 -07:00
..
CMakeLists.txt
README.md
RocksDBInvertedLists.cpp Fix missing overload variable in Rocksdb ivf demo (#3326) 2024-04-02 06:11:53 -07:00
RocksDBInvertedLists.h Fix missing overload variable in Rocksdb ivf demo (#3326) 2024-04-02 06:11:53 -07:00
demo_rocksdb_ivf.cpp

README.md

Storing Faiss inverted lists in RocksDB

Demo of storing the inverted lists of any IVF index in RocksDB or any similar key-value store which supports the prefix scan operation.

How to build

We use conda to create the build environment for simplicity. Only tested on Linux x86.

conda create -n rocksdb_ivf
conda activate rocksdb_ivf
conda install pytorch::faiss-cpu conda-forge::rocksdb cmake make gxx_linux-64 sysroot_linux-64
cd ~/faiss/demos/rocksdb_ivf
cmake -B build .
make -C build -j$(nproc)

Run the example

cd ~/faiss/demos/rocksdb_ivf/build
./rocksdb_ivf test_db