pub struct RowNumberProvider { /* private fields */ }Expand description
Provides stable encoded numbers for keys with automatic Insert/Update detection
This component maintains:
- A sequential counter for generating new encoded numbers
- A mapping from keys to their assigned encoded numbers
When a key is seen for the first time, it gets a new encoded number and returns true. When a key is seen again, it returns the existing encoded number and false.
Implementations§
Source§impl RowNumberProvider
impl RowNumberProvider
Sourcepub fn new(node: FlowNodeId) -> Self
pub fn new(node: FlowNodeId) -> Self
Create a new RowNumberProvider for the given operator
Sourcepub fn get_or_create_row_number<O: RawStatefulOperator>(
&self,
txn: &mut FlowTransaction,
operator: &O,
key: &EncodedKey,
) -> Result<(RowNumber, bool)>
pub fn get_or_create_row_number<O: RawStatefulOperator>( &self, txn: &mut FlowTransaction, operator: &O, key: &EncodedKey, ) -> Result<(RowNumber, bool)>
Get or create a RowNumber for a given key Returns (RowNumber, is_new) where is_new indicates if it was newly created
Sourcepub fn remove_by_prefix<O: RawStatefulOperator>(
&self,
txn: &mut FlowTransaction,
operator: &O,
key_prefix: &[u8],
) -> Result<()>
pub fn remove_by_prefix<O: RawStatefulOperator>( &self, txn: &mut FlowTransaction, operator: &O, key_prefix: &[u8], ) -> Result<()>
Remove all encoded number mappings with the given prefix This is useful for cleaning up all join results from a specific left encoded
Auto Trait Implementations§
impl Freeze for RowNumberProvider
impl RefUnwindSafe for RowNumberProvider
impl Send for RowNumberProvider
impl Sync for RowNumberProvider
impl Unpin for RowNumberProvider
impl UnwindSafe for RowNumberProvider
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
Mutably borrows from an owned value. Read more