narrow_down.scylladb module#
Storage backend based on ScyllaDB.
ScyllaDB is a low-latency distributed key-value store, compatible with the Apache Cassandra protocol. For details see https://www.scylladb.com/.
- class narrow_down.scylladb.ScyllaDBStore(cluster_or_session, keyspace, table_prefix=None)[source]#
Bases:
StorageBackend
Storage backend for a SimilarityStore using ScyllaDB.
- Parameters:
- __init__(cluster_or_session, keyspace, table_prefix=None)[source]#
Create a new empty or connect to an existing SQLite database.
- Parameters:
- Raises:
ValueError – When the keyspace name is invalid.
- Return type:
None
- async initialize()[source]#
Initialize the tables in the SQLite database file.
- Returns:
self
- Return type:
- async insert_document(document, document_id=None)[source]#
Add the data of a document to the storage and return its ID.
- async remove_document(document_id)[source]#
Remove a document given by ID from the list of documents.
- Parameters:
document_id (int) –
- async add_document_to_bucket(bucket_id, document_hash, document_id)[source]#
Link a document to a bucket.