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_numbers<'a, I>(
&self,
txn: &mut FlowTransaction,
keys: I,
) -> Result<Vec<(RowNumber, bool)>>where
I: IntoIterator<Item = &'a EncodedKey>,
pub fn get_or_create_row_numbers<'a, I>(
&self,
txn: &mut FlowTransaction,
keys: I,
) -> Result<Vec<(RowNumber, bool)>>where
I: IntoIterator<Item = &'a EncodedKey>,
Get or create RowNumbers for multiple keys Returns Vec<(RowNumber, is_new)> in the same order as input keys where is_new indicates if the row number was newly created
Sourcepub fn get_or_create_row_number(
&self,
txn: &mut FlowTransaction,
key: &EncodedKey,
) -> Result<(RowNumber, bool)>
pub fn get_or_create_row_number( &self, txn: &mut FlowTransaction, 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 get_key_for_row_number(
&self,
txn: &mut FlowTransaction,
row_number: RowNumber,
) -> Result<Option<EncodedKey>>
pub fn get_key_for_row_number( &self, txn: &mut FlowTransaction, row_number: RowNumber, ) -> Result<Option<EncodedKey>>
Get the original key for a given row number (reverse lookup)
Sourcepub fn remove_by_prefix(
&self,
txn: &mut FlowTransaction,
key_prefix: &[u8],
) -> Result<()>
pub fn remove_by_prefix( &self, txn: &mut FlowTransaction, 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 UnsafeUnpin 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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request