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,
) -> 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,
) -> 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,
) -> 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,
) -> 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,
) -> 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§
Sourcefn put_non_tombstone<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
metadata: &'life2 Metadata,
payload: Bytes,
) -> 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 put_non_tombstone<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
metadata: &'life2 Metadata,
payload: Bytes,
) -> 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.
Sourcefn get_tiered_object<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
) -> Pin<Box<dyn Future<Output = Result<TieredGet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tiered_object<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
) -> Pin<Box<dyn Future<Output = Result<TieredGet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves 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.
Sourcefn get_tiered_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
) -> Pin<Box<dyn Future<Output = Result<TieredMetadata>> + 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,
) -> 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.
Sourcefn delete_non_tombstone<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
) -> Pin<Box<dyn Future<Output = Result<Option<Tombstone>>> + 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,
) -> 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.
Sourcefn compare_and_write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
current: Option<&'life2 ObjectId>,
write: TieredWrite,
) -> 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_write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 ObjectId,
current: Option<&'life2 ObjectId>,
write: TieredWrite,
) -> 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 tombstone exists (row absent or inline).Some(target): succeeds only if a tombstone exists whose redirect resolves totarget.
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).