Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: support RocksDB databases in sourmash proper through FFI #3545

Open
wants to merge 17 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ include/sourmash.h: src/core/src/lib.rs \
src/core/src/ffi/nodegraph.rs \
src/core/src/ffi/index/mod.rs \
src/core/src/ffi/index/revindex.rs \
src/core/src/ffi/index/disk_revindex.rs \
src/core/src/ffi/storage.rs \
src/core/src/errors.rs \
src/core/cbindgen.toml
cd src/core && \
RUSTC_BOOTSTRAP=1 cbindgen -c cbindgen.toml . -o ../../$@
RUSTC_BOOTSTRAP=1 cbindgen -c cbindgen.toml . -o ../../$@ -v

coverage: all
tox -e coverage
Expand Down
33 changes: 33 additions & 0 deletions include/sourmash.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ typedef uint32_t SourmashErrorCode;

typedef struct SourmashComputeParameters SourmashComputeParameters;

typedef struct SourmashDiskRevIndex SourmashDiskRevIndex;

typedef struct SourmashHyperLogLog SourmashHyperLogLog;

typedef struct SourmashKmerMinHash SourmashKmerMinHash;
Expand Down Expand Up @@ -138,6 +140,37 @@ void computeparams_set_track_abundance(SourmashComputeParameters *ptr, bool v);

bool computeparams_track_abundance(const SourmashComputeParameters *ptr);

SourmashSignature *disk_revindex_best_containment(const SourmashDiskRevIndex *db_ptr,
const SourmashSignature *query_ptr,
uint16_t threshold_bp);

void disk_revindex_free(SourmashDiskRevIndex *ptr);

uint64_t disk_revindex_ksize(const SourmashDiskRevIndex *ptr);

uint64_t disk_revindex_len(const SourmashDiskRevIndex *ptr);

const char *disk_revindex_moltype(const SourmashDiskRevIndex *ptr);

SourmashDiskRevIndex *disk_revindex_new_from_rocksdb(const char *path_ptr);

SourmashSignature *disk_revindex_peek(const SourmashDiskRevIndex *db_ptr,
const SourmashKmerMinHash *query_ptr);

const SourmashSearchResult *const *disk_revindex_prefetch(const SourmashDiskRevIndex *db_ptr,
const SourmashSignature *query_ptr,
uint64_t threshold_bp,
uintptr_t *return_size);

uint32_t disk_revindex_scaled(const SourmashDiskRevIndex *ptr);

const SourmashSearchResult *const *disk_revindex_search_jaccard(const SourmashDiskRevIndex *db_ptr,
const SourmashSignature *query_ptr,
double threshold,
uintptr_t *return_size);

SourmashSignature **disk_revindex_signatures(const SourmashDiskRevIndex *ptr, uintptr_t *size);

uint64_t hash_murmur(const char *kmer, uint64_t seed);

void hll_add_hash(SourmashHyperLogLog *ptr, uint64_t hash);
Expand Down
Loading
Loading