Skip to main content

SimdDsonProcessor

Struct SimdDsonProcessor 

Source
pub struct SimdDsonProcessor { /* private fields */ }
Expand description

SIMD-accelerated DSON processor implementing all DSON traits

Implementations§

Source§

impl SimdDsonProcessor

Source

pub fn new(replica_id: &str) -> SimdDsonProcessor

Create a new SIMD DSON processor

Source

pub fn with_schema( replica_id: &str, input_schema: Vec<String>, output_schema: Vec<String>, ) -> SimdDsonProcessor

Create with schema filtering

Source

pub const fn with_parallel(self, enabled: bool) -> SimdDsonProcessor

Enable parallel processing

Source

pub const fn is_parallel(&self) -> bool

Check if parallel processing is enabled

Source§

impl SimdDsonProcessor

Source

pub fn process_batch_parallel( &self, documents: Vec<String>, ) -> Result<Vec<String>, DsonError>

Process multiple documents in parallel

§Errors

Returns an error if parallel processing is not enabled or if any document fails to process.

Source

pub fn apply_operations_parallel( &mut self, ops: Vec<DsonOperation>, ) -> Result<Vec<Option<MergeConflict>>, DsonError>

Apply operations in parallel where order-independent

§Errors

Returns an error if any operation fails to apply.

Source

pub fn merge_replicas_parallel( &mut self, replica_ops: Vec<(String, Vec<CrdtOperation>)>, _strategy: &MergeStrategy, ) -> Result<Vec<MergeConflict>, DsonError>

Merge operations from multiple replicas in parallel

§Errors

Returns an error if any merge operation fails.

Trait Implementations§

Source§

impl ArrayOperations for SimdDsonProcessor

Source§

fn array_insert( &mut self, path: &str, index: usize, value: OperationValue, ) -> Result<(), DsonError>

Insert value at index in array at path Read more
Source§

fn array_remove(&mut self, path: &str, index: usize) -> Result<(), DsonError>

Remove element at index from array at path Read more
Source§

fn array_replace( &mut self, path: &str, index: usize, value: OperationValue, ) -> Result<(), DsonError>

Replace element at index in array at path Read more
Source§

fn array_len(&self, path: &str) -> Result<usize, DsonError>

Get array length at path Read more
Source§

fn array_build( &mut self, path: &str, elements: Vec<OperationValue>, ) -> Result<(), DsonError>

Build array from elements Read more
Source§

fn array_filter( &mut self, path: &str, predicate: &FilterPredicate, ) -> Result<(), DsonError>

Filter array elements Read more
Source§

fn array_map( &mut self, path: &str, transform: &TransformFunction, ) -> Result<(), DsonError>

Map over array elements Read more
Source§

fn array_reduce( &mut self, path: &str, initial: OperationValue, reducer: &ReduceFunction, ) -> Result<OperationValue, DsonError>

Reduce array to single value Read more
Source§

impl CrdtMerge for SimdDsonProcessor

Source§

fn merge_operation( &mut self, op: CrdtOperation, ) -> Result<Option<MergeConflict>, DsonError>

Merge a remote operation into local state Read more
Source§

fn merge_field( &mut self, path: &str, value: OperationValue, timestamp: u64, strategy: &MergeStrategy, ) -> Result<Option<MergeConflict>, DsonError>

Merge field with CRDT semantics Read more
Source§

fn vector_clock(&self) -> &VectorClock

Get the current vector clock
Source§

fn replica_id(&self) -> &str

Get the replica ID
Source§

fn resolve_conflict( &mut self, conflict: &MergeConflict, strategy: &MergeStrategy, ) -> Result<OperationValue, DsonError>

Resolve a conflict using the specified strategy Read more
Source§

impl DeltaCrdt for SimdDsonProcessor

Source§

type Delta = SimdDelta

Type representing a delta (difference from previous state)
Source§

fn generate_delta( &self, since: &VectorClock, ) -> <SimdDsonProcessor as DeltaCrdt>::Delta

Generate delta since given vector clock
Source§

fn apply_delta( &mut self, delta: <SimdDsonProcessor as DeltaCrdt>::Delta, ) -> Result<Vec<MergeConflict>, DsonError>

Apply delta from remote replica Read more
Source§

fn compact(&mut self)

Compact/garbage collect old deltas
Source§

impl DocumentProcessor for SimdDsonProcessor

Source§

fn process(&mut self, input: &str) -> Result<String, DsonError>

Process input JSON and return transformed output Read more
Source§

fn apply_operation(&mut self, op: &DsonOperation) -> Result<(), DsonError>

Apply a single operation Read more
Source§

fn output(&self) -> Result<String, DsonError>

Generate output from current state Read more
Source§

fn apply_operations(&mut self, ops: &[DsonOperation]) -> Result<(), DsonError>

Apply a batch of operations Read more
Source§

impl DsonImplementation for SimdDsonProcessor

Source§

fn name(&self) -> &'static str

Implementation name for comparison
Source§

fn version(&self) -> &'static str

Implementation version
Source§

fn features(&self) -> Vec<&str>

Supported features
Source§

fn characteristics(&self) -> ImplementationCharacteristics

Performance characteristics
Source§

impl FieldOperations for SimdDsonProcessor

Source§

fn field_add( &mut self, path: &str, value: OperationValue, ) -> Result<(), DsonError>

Add a field at path with value Read more
Source§

fn field_modify( &mut self, path: &str, value: OperationValue, ) -> Result<(), DsonError>

Modify existing field at path Read more
Source§

fn field_delete(&mut self, path: &str) -> Result<(), DsonError>

Delete field at path Read more
Source§

fn field_read(&self, path: &str) -> Result<Option<OperationValue>, DsonError>

Read field value at path Read more
Source§

fn field_exists(&self, path: &str) -> bool

Check if field exists at path
Source§

impl OpBasedCrdt for SimdDsonProcessor

Source§

fn prepare(&self, op: &DsonOperation) -> Result<CrdtOperation, DsonError>

Prepare an operation for broadcast (downstream precondition) Read more
Source§

fn effect( &mut self, op: CrdtOperation, ) -> Result<Option<MergeConflict>, DsonError>

Effect an operation (apply after delivery) Read more
Source§

fn is_causally_ready(&self, op: &CrdtOperation) -> bool

Check if operation is causally ready to be applied
Source§

fn buffer_operation(&mut self, op: CrdtOperation)

Buffer operation until causally ready
Source§

fn process_buffered(&mut self) -> Result<Vec<MergeConflict>, DsonError>

Process buffered operations that are now ready Read more
Source§

impl SchemaAware for SimdDsonProcessor

Source§

fn matches_input_schema(&self, path: &str) -> bool

Check if a path matches the input schema
Source§

fn matches_output_schema(&self, path: &str) -> bool

Check if a path matches the output schema
Source§

fn input_schema(&self) -> Vec<String>

Get input schema paths
Source§

fn output_schema(&self) -> Vec<String>

Get output schema paths

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.