pub struct StateletClient { /* private fields */ }Expand description
Async gRPC client for Statelet.
Implementations§
Source§impl StateletClient
impl StateletClient
Sourcepub fn set_default_cf(&mut self, cf: u32)
pub fn set_default_cf(&mut self, cf: u32)
Set the default column family id.
Sourcepub async fn put(
&mut self,
key: &[u8],
value: &[u8],
cf: Option<u32>,
) -> Result<(), Status>
pub async fn put( &mut self, key: &[u8], value: &[u8], cf: Option<u32>, ) -> Result<(), Status>
Write a single key-value pair.
Sourcepub async fn get(
&mut self,
key: &[u8],
cf: Option<u32>,
) -> Result<Option<Vec<u8>>, Status>
pub async fn get( &mut self, key: &[u8], cf: Option<u32>, ) -> Result<Option<Vec<u8>>, Status>
Read the value for a key. Returns None if not found.
Sourcepub async fn delete(
&mut self,
key: &[u8],
cf: Option<u32>,
) -> Result<(), Status>
pub async fn delete( &mut self, key: &[u8], cf: Option<u32>, ) -> Result<(), Status>
Delete a key.
Sourcepub async fn merge(
&mut self,
key: &[u8],
value: &[u8],
cf: Option<u32>,
) -> Result<(), Status>
pub async fn merge( &mut self, key: &[u8], value: &[u8], cf: Option<u32>, ) -> Result<(), Status>
Merge an operand into the existing value.
Sourcepub async fn batch_write(&mut self, ops: Vec<WriteOp>) -> Result<(), Status>
pub async fn batch_write(&mut self, ops: Vec<WriteOp>) -> Result<(), Status>
Atomically apply a batch of write operations.
Sourcepub async fn scan(
&mut self,
prefix: &[u8],
cursor: Option<&[u8]>,
limit: u32,
cf: Option<u32>,
) -> Result<(Vec<(Vec<u8>, Vec<u8>)>, Option<Vec<u8>>), Status>
pub async fn scan( &mut self, prefix: &[u8], cursor: Option<&[u8]>, limit: u32, cf: Option<u32>, ) -> Result<(Vec<(Vec<u8>, Vec<u8>)>, Option<Vec<u8>>), Status>
Scan keys with an optional prefix filter. Returns entries and next cursor.
Sourcepub async fn delete_by_prefix(
&mut self,
prefix: &[u8],
cf: Option<u32>,
) -> Result<u32, Status>
pub async fn delete_by_prefix( &mut self, prefix: &[u8], cf: Option<u32>, ) -> Result<u32, Status>
Delete all keys matching a prefix. Returns the number of keys deleted.
Sourcepub async fn create_vector_index(
&mut self,
name: &str,
config: VectorIndexConfig,
) -> Result<(), Status>
pub async fn create_vector_index( &mut self, name: &str, config: VectorIndexConfig, ) -> Result<(), Status>
Create or reconfigure an HNSW vector index.
Sourcepub async fn drop_vector_index(&mut self, name: &str) -> Result<(), Status>
pub async fn drop_vector_index(&mut self, name: &str) -> Result<(), Status>
Drop an HNSW vector index.
Sourcepub async fn vector_put(
&mut self,
index_name: &str,
vector_id: u64,
vector: Vec<f32>,
) -> Result<(), Status>
pub async fn vector_put( &mut self, index_name: &str, vector_id: u64, vector: Vec<f32>, ) -> Result<(), Status>
Insert or update a vector.
Sourcepub async fn vector_delete(
&mut self,
index_name: &str,
vector_id: u64,
) -> Result<(), Status>
pub async fn vector_delete( &mut self, index_name: &str, vector_id: u64, ) -> Result<(), Status>
Remove a vector from the index.
Sourcepub async fn vector_search(
&mut self,
index_name: &str,
query: Vec<f32>,
k: u32,
ef_search: Option<u32>,
) -> Result<Vec<VectorSearchResult>, Status>
pub async fn vector_search( &mut self, index_name: &str, query: Vec<f32>, k: u32, ef_search: Option<u32>, ) -> Result<Vec<VectorSearchResult>, Status>
Approximate nearest neighbor search.
Sourcepub async fn vector_search_reranked(
&mut self,
index_name: &str,
query: Vec<f32>,
k: u32,
ef_search: Option<u32>,
rerank: Option<RerankSpec>,
) -> Result<Vec<VectorSearchResult>, Status>
pub async fn vector_search_reranked( &mut self, index_name: &str, query: Vec<f32>, k: u32, ef_search: Option<u32>, rerank: Option<RerankSpec>, ) -> Result<Vec<VectorSearchResult>, Status>
Approximate nearest neighbor search with an optional second-stage reranker.
Pass a proto::RerankSpec to enable the cross-encoder or model-free
score-fusion rerank over an over-fetched candidate window — the analogue
of Weaviate .with_additional({rerank}) / Pinecone inference.rerank.
None ⇒ no rerank (identical to Self::vector_search). See
docs/reranking.md for the two models and signal_blend semantics.
Sourcepub async fn vector_search_grouped(
&mut self,
index_name: &str,
query: Vec<f32>,
k: u32,
ef_search: Option<u32>,
group: GroupSpec,
) -> Result<Vec<VectorSearchResult>, Status>
pub async fn vector_search_grouped( &mut self, index_name: &str, query: Vec<f32>, k: u32, ef_search: Option<u32>, group: GroupSpec, ) -> Result<Vec<VectorSearchResult>, Status>
Approximate nearest neighbor search with result grouping / field-collapse (epic #1427).
Collapse results to at most GroupSpec::group_size hits per distinct
value of GroupSpec::field, returning up to GroupSpec::groups
distinct group keys (each result’s value surfaced on
VectorSearchResult::group_key). Grouping is exact on single-shard
deployments and best-effort across shards (tune via GroupSpec::overfetch).
Grouping is mutually exclusive with MMR. The analogue of Qdrant
query_groups / Weaviate groupBy / Milvus grouping_field.
Sourcepub async fn rerank_validate(
&mut self,
index_name: &str,
rerank: RerankSpec,
) -> Result<(), Status>
pub async fn rerank_validate( &mut self, index_name: &str, rerank: RerankSpec, ) -> Result<(), Status>
Dry-run pre-flight validation of a proto::RerankSpec.
Issues a validate_only vector search that validates the
passage_field template (and, for model = "cross-encoder", that a
reranker is loaded on the gateway) without executing the search.
Returns Ok(()) when the spec is valid; the underlying
InvalidArgument / FailedPrecondition tonic::Status otherwise.
Mirrors Weaviate’s “property exists?” / Pinecone’s “rank_fields valid?”
pre-flight.
Sourcepub async fn vector_get(
&mut self,
index_name: &str,
vector_id: u64,
) -> Result<Option<Vec<f32>>, Status>
pub async fn vector_get( &mut self, index_name: &str, vector_id: u64, ) -> Result<Option<Vec<f32>>, Status>
Retrieve a stored vector by id.
Sourcepub async fn graph_query(
&mut self,
cypher: &str,
options: GraphQueryOptions,
) -> Result<GraphQueryResult, Status>
pub async fn graph_query( &mut self, cypher: &str, options: GraphQueryOptions, ) -> Result<GraphQueryResult, Status>
Run a read-only openCypher-subset query.
Gateway-only: the gateway parses and plans the query, then compiles it to
engine traversal primitives. The subset covers MATCH path patterns,
WHERE over node properties, RETURN / ORDER BY / LIMIT, a
bitemporal AS OF <valid>[, <tx>] clause, and the retrieval procedures
db.vectorSearch / db.hybridSearch / db.graphRag. CREATE / MERGE
are rejected.
GraphQueryOptions::default() means “let the gateway decide”: the
default graph, no extra row cap and no temporal filter on either axis.
Named query parameters ($q) parse but are not resolvable yet, so a
vector-seeded procedure needs an inline literal —
db.vectorSearch([0.1, 0.2, ...], 5).
Sourcepub async fn subscribe_committed<H, E>(
&mut self,
opts: SubscribeCommittedOptions<'_>,
handler: H,
) -> Result<(), ConsumeError<E>>
pub async fn subscribe_committed<H, E>( &mut self, opts: SubscribeCommittedOptions<'_>, handler: H, ) -> Result<(), ConsumeError<E>>
Consume the durable, ordered, resumable committed change-feed (CDC).
Invokes handler for each cdc::CommittedChange in stable Raft-offset
order, driving the canonical Phase-5b algorithm: client-managed offsets
(supply subscription_id + checkpoint to resume across restarts),
bootstrap-on-compacted via a paged Self::scan, heartbeat-advances-
checkpoint, reconnect-on-disconnect from last_offset + 1, and
at-least-once delivery (with auto_commit, each offset is committed
after handler returns Ok(true)).
handler returns Ok(true) to continue, Ok(false) to stop cleanly, or
Err(e) to stop with cdc::ConsumeError::Handler. The future runs
until the handler stops it (the live tail never ends on its own).
Trait Implementations§
Source§impl FeedTransport for StateletClient
impl FeedTransport for StateletClient
type Stream = GrpcFeedStream
Source§fn open_feed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
shard_id: u64,
from_offset: u64,
cf: u32,
key_prefix: &'life1 [u8],
include_values: bool,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn open_feed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
shard_id: u64,
from_offset: u64,
cf: u32,
key_prefix: &'life1 [u8],
include_values: bool,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
from_offset.Source§fn scan_page<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
prefix: &'life1 [u8],
cursor: Option<&'life2 [u8]>,
limit: u32,
cf: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<(Vec<u8>, Vec<u8>)>, Option<Vec<u8>>), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn scan_page<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
prefix: &'life1 [u8],
cursor: Option<&'life2 [u8]>,
limit: u32,
cf: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<(Vec<u8>, Vec<u8>)>, Option<Vec<u8>>), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
(entries, next_cursor) with next_cursor = None
when there are no more results.Auto Trait Implementations§
impl !Freeze for StateletClient
impl !RefUnwindSafe for StateletClient
impl !UnwindSafe for StateletClient
impl Send for StateletClient
impl Sync for StateletClient
impl Unpin for StateletClient
impl UnsafeUnpin for StateletClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request