pub struct InternalQueueTransaction {
pub db: InternalQueueDB,
pub batch: WriteBatch,
pub buffer: Vec<u8>,
}Fields§
§db: InternalQueueDB§batch: WriteBatch§buffer: Vec<u8>Implementations§
Source§impl InternalQueueTransaction
impl InternalQueueTransaction
pub fn size(&self) -> (usize, usize)
pub fn write(self) -> Result<()>
pub fn insert_statistics(&mut self, key: &StatKey, count: u64)
pub fn insert_diff_tail(&mut self, key: &DiffTailKey, value: &[u8])
pub fn insert_diff_info(&mut self, key: &DiffInfoKey, value: &[u8])
pub fn insert_message( &mut self, key: &ShardsInternalMessagesKey, dest: &IntAddr, value: &[u8], )
Sourcepub fn commit_messages(
&mut self,
commit_pointers: FastHashMap<ShardIdent, (QueueKey, u32)>,
) -> Result<()>
pub fn commit_messages( &mut self, commit_pointers: FastHashMap<ShardIdent, (QueueKey, u32)>, ) -> Result<()>
Updates commit pointers in message queue. ATTENTION! Overrides old value without checks. Should validate the new value in the calling code.
Sourcepub fn clear_uncommitted(
&self,
partitions: &FastHashSet<QueuePartitionIdx>,
commit_pointers: &FastHashMap<ShardIdent, CommitPointerValue>,
top_shards: &[ShardIdent],
) -> Result<()>
pub fn clear_uncommitted( &self, partitions: &FastHashSet<QueuePartitionIdx>, commit_pointers: &FastHashMap<ShardIdent, CommitPointerValue>, top_shards: &[ShardIdent], ) -> Result<()>
Removes all keys that are strictly above the committed pointers in each partition.
(Anything above pointer + 1 is considered “uncommitted” and will be deleted.)
commit_pointers: a map of (ShardIdent-> last committedQueueKey)partitions: a list of partitions (e.g. 0..255) to cleartop_shards: a list of all shards for backoff when no commit pointers
pub fn delete(&self, ranges: &[QueueRange]) -> Result<()>
Sourcepub fn set_last_committed_mc_block_id(
&mut self,
mc_block_id: &BlockId,
) -> Result<()>
pub fn set_last_committed_mc_block_id( &mut self, mc_block_id: &BlockId, ) -> Result<()>
Stores mc block id on which the queue was committed. ATTENTION! Overrides old value without checks. Should validate the new value in the calling code.
Auto Trait Implementations§
impl Freeze for InternalQueueTransaction
impl RefUnwindSafe for InternalQueueTransaction
impl Send for InternalQueueTransaction
impl !Sync for InternalQueueTransaction
impl Unpin for InternalQueueTransaction
impl UnsafeUnpin for InternalQueueTransaction
impl UnwindSafe for InternalQueueTransaction
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
Source§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>
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 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>
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