Skip to main content

HighVolumeBackend

Trait HighVolumeBackend 

Source
pub trait HighVolumeBackend: Backend {
    // Required methods
    fn put_non_tombstone<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        metadata: &'life2 Metadata,
        payload: Bytes,
        access_time: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Tombstone>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_tiered_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        access_time: Timestamp,
        range: Option<ByteRange>,
    ) -> Pin<Box<dyn Future<Output = Result<TieredGet>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_tiered_metadata<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        access_time: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<TieredMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_non_tombstone<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        access_time: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Tombstone>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn compare_and_write<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        current: Option<&'life2 ObjectId>,
        write: TieredWrite,
        access_time: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn compare_and_update<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 ObjectId,
        current: Option<&'life2 ObjectId>,
        update: TieredUpdate,
        access_time: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for backends that support tombstone-conditional operations.

Only backends suitable for the high-volume tier of TieredStorage implement this trait. The conditional methods provide atomic operations to avoid overwriting redirect tombstones.

Required Methods§

Source

fn put_non_tombstone<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ObjectId, metadata: &'life2 Metadata, payload: Bytes, access_time: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Option<Tombstone>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Writes the object only if NO redirect tombstone exists at this key.

Returns None after storing the object, or Some(tombstone) (skipping the write) when a redirect tombstone is present. The returned tombstone carries the target LT ObjectId so the caller can route without a second round trip.

Takes [Bytes] instead of a ClientStream because callers on this path have already fully buffered the payload.

Source

fn get_tiered_object<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ObjectId, access_time: Timestamp, range: Option<ByteRange>, ) -> Pin<Box<dyn Future<Output = Result<TieredGet>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves (part of) an object with explicit tombstone awareness.

Returns TieredGet::Tombstone instead of synthesizing a tombstone object, making the caller’s routing logic a compile-time distinction.

Source

fn get_tiered_metadata<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ObjectId, access_time: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<TieredMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves only metadata with explicit tombstone awareness.

Implementations should skip the payload column where possible to avoid fetching up to 1 MiB of data just to discover a tombstone.

Source

fn delete_non_tombstone<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ObjectId, access_time: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Option<Tombstone>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes the object only if it is NOT a redirect tombstone.

Returns None after deleting the row (or if the row was already absent), or Some(tombstone) (leaving the row intact) when the object is a redirect tombstone. The returned tombstone carries the target LT ObjectId so the caller can delete from long-term storage directly, without a second round trip.

Source

fn compare_and_write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ObjectId, current: Option<&'life2 ObjectId>, write: TieredWrite, access_time: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically mutates the row if the current redirect state matches.

current determines the precondition:

  • None: succeeds only if no live tombstone exists (row absent, inline, or tombstone present but logically expired).
  • Some(target): succeeds only if a tombstone exists whose redirect resolves to target.

This operation is idempotent: if the object is already in the target state, it returns true. Whether the mutation runs again is up to the implementation.

Returns true on success or idempotent match, false if a conflicting state was found (another writer won the race).

Source

fn compare_and_update<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ObjectId, current: Option<&'life2 ObjectId>, update: TieredUpdate, access_time: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically updates an existing row if its kind and redirect target match.

current = None requires a live inline object. Some(target) requires a live redirect to exactly that target. Updates never authorize creation of an absent row.

Returns true when the update was applied or its requested state was already satisfied. Returns false for an absent, expired, or conflicting entry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§