Skip to content
Merged
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
File renamed without changes.
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

8 changes: 2 additions & 6 deletions crates/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::sync::{Arc, RwLock};
use index::flat::FlatIndex;
use index::{IndexType, VectorIndex};
use storage::rocks_db::RocksDbStorage;
use storage::{StorageEngine, StorageType};
use storage::{StorageEngine, StorageType, VectorPage};

use uuid::Uuid;

Expand Down Expand Up @@ -101,11 +101,7 @@ impl VectorDb {
Ok(vectors)
}

pub fn list(
&self,
offset: PointId,
limit: usize,
) -> Result<Option<(Vec<(PointId, DenseVector)>, PointId)>, DbError> {
pub fn list(&self, offset: PointId, limit: usize) -> Result<Option<VectorPage>, DbError> {
self.storage.list_vectors(offset, limit)
}

Expand Down
8 changes: 2 additions & 6 deletions crates/storage/src/in_memory.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::StorageEngine;
use crate::{StorageEngine, VectorPage};
use defs::{DbError, DenseVector, Payload, PointId};

pub struct MemoryStorage {
Expand Down Expand Up @@ -38,11 +38,7 @@ impl StorageEngine for MemoryStorage {
fn get_vector(&self, _id: PointId) -> Result<Option<DenseVector>, DbError> {
Ok(None)
}
fn list_vectors(
&self,
_offset: PointId,
_limit: usize,
) -> Result<Option<(Vec<(PointId, DenseVector)>, PointId)>, DbError> {
fn list_vectors(&self, _offset: PointId, _limit: usize) -> Result<Option<VectorPage>, DbError> {
Ok(None)
}
}
8 changes: 3 additions & 5 deletions crates/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::sync::Arc;

use crate::rocks_db::RocksDbStorage;

pub type VectorPage = (Vec<(PointId, DenseVector)>, PointId);

pub trait StorageEngine: Send + Sync {
fn insert_point(
&self,
Expand All @@ -15,11 +17,7 @@ pub trait StorageEngine: Send + Sync {
fn get_payload(&self, id: PointId) -> Result<Option<Payload>, DbError>;
fn delete_point(&self, id: PointId) -> Result<(), DbError>;
fn contains_point(&self, id: PointId) -> Result<bool, DbError>;
fn list_vectors(
&self,
offset: PointId,
limit: usize,
) -> Result<Option<(Vec<(PointId, DenseVector)>, PointId)>, DbError>;
fn list_vectors(&self, offset: PointId, limit: usize) -> Result<Option<VectorPage>, DbError>;
}

pub mod in_memory;
Expand Down
8 changes: 2 additions & 6 deletions crates/storage/src/rocks_db.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Rewrite needed

use crate::StorageEngine;
use crate::{StorageEngine, VectorPage};
use bincode::{deserialize, serialize};
use defs::{DbError, DenseVector, Payload, Point, PointId};
use rocksdb::{Error, Options, DB};
Expand Down Expand Up @@ -122,11 +122,7 @@ impl StorageEngine for RocksDbStorage {
Ok(value.vector)
}

fn list_vectors(
&self,
offset: PointId,
limit: usize,
) -> Result<Option<(Vec<(PointId, DenseVector)>, PointId)>, DbError> {
fn list_vectors(&self, offset: PointId, limit: usize) -> Result<Option<VectorPage>, DbError> {
if limit < 1 {
return Ok(None);
}
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.yml

This file was deleted.

29 changes: 0 additions & 29 deletions tasks.md

This file was deleted.

Loading