Skip to main content

BlobStoreClient

Trait BlobStoreClient 

Source
pub trait BlobStoreClient: Send + Sync {
    // Provided methods
    fn put_blob_chunks(
        &self,
        blob_id: StrHash,
        payload: Arc<[u8]>,
    ) -> impl Future<Output = Result<(), Status>> + Send { ... }
    fn put_blobs(
        &self,
        blobs: &[(StrHash, Arc<[u8]>)],
    ) -> impl Future<Output = Result<(), Status>> + Send { ... }
    fn get_blobs(
        &self,
        ids: &[StrHash],
    ) -> impl Future<Output = Result<Vec<Option<Vec<u8>>>, Status>> + Send { ... }
}
Expand description

Content-addressed blob client against the registry process.

Compute-only (query residual / output materialization on the read side, write fan-out on the write side); hexastore partitions never fetch blobs. Payloads travel as Arc<[u8]> so callers (write fan-out, cache pre-warm) share one buffer across batch frames and retry attempts instead of copying.

§Write-path contract

  • Self::put_blobs sends whole blobs batched into ONE unary request. The caller frames batches under crate::PUT_BLOBS_BATCH_BYTES so every request fits the gRPC message ceiling. The server commits the batch atomically: every content hash is validated before anything is written, and one index commit carries the whole batch — so a failed call leaves no index entries, and retrying the whole batch idempotently is safe under content addressing (every retry re-validates the same content hash; ids that already exist skip).
  • Self::put_blob_chunks streams ONE oversized blob chunk-by-chunk under the frame budget (blobs above the batch budget).

In both cases a failure returns Err and the caller retries per its retry policy; a blob must never be visible at its content address without full validation.

Provided Methods§

Source

fn put_blob_chunks( &self, blob_id: StrHash, payload: Arc<[u8]>, ) -> impl Future<Output = Result<(), Status>> + Send

Stream one blob’s chunks under the gRPC message budget (legacy path for blobs above the PutBlobs batch budget; the 64 MiB blob size limit is enforced server-side at assembly).

Source

fn put_blobs( &self, blobs: &[(StrHash, Arc<[u8]>)], ) -> impl Future<Output = Result<(), Status>> + Send

Put a batch of whole blobs in one unary request (see the trait docs for the idempotency / atomicity contract). Batches are framed by the caller under crate::PUT_BLOBS_BATCH_BYTES.

Source

fn get_blobs( &self, ids: &[StrHash], ) -> impl Future<Output = Result<Vec<Option<Vec<u8>>>, Status>> + Send

Batched get: payloads aligned with ids (None = miss).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§