pub struct MessageQueueAdapterStdImpl<V: InternalMessageValue> { /* private fields */ }Implementations§
Source§impl<V: InternalMessageValue> MessageQueueAdapterStdImpl<V>
impl<V: InternalMessageValue> MessageQueueAdapterStdImpl<V>
pub fn new(queue: QueueImpl<QueueStateStdImpl, V>) -> Self
Trait Implementations§
Source§impl<V: InternalMessageValue> MessageQueueAdapter<V> for MessageQueueAdapterStdImpl<V>
impl<V: InternalMessageValue> MessageQueueAdapter<V> for MessageQueueAdapterStdImpl<V>
Source§fn create_iterator(
&self,
for_shard_id: ShardIdent,
partition: QueuePartitionIdx,
ranges: Vec<QueueShardBoundedRange>,
) -> Result<Box<dyn QueueIterator<V>>>
fn create_iterator( &self, for_shard_id: ShardIdent, partition: QueuePartitionIdx, ranges: Vec<QueueShardBoundedRange>, ) -> Result<Box<dyn QueueIterator<V>>>
Create iterator for specified shard and return it
Source§fn get_statistics(
&self,
partitions: &FastHashSet<QueuePartitionIdx>,
ranges: &[QueueShardBoundedRange],
) -> Result<QueueStatistics>
fn get_statistics( &self, partitions: &FastHashSet<QueuePartitionIdx>, ranges: &[QueueShardBoundedRange], ) -> Result<QueueStatistics>
Returns statistics for the specified ranges by partition
and source shards (equal to iterator ranges)
Source§fn prepare_diff(
&self,
diff: QueueDiffWithMessages<V>,
block_id_short: BlockIdShort,
diff_hash: &HashBytes,
statistics: DiffStatistics,
check_sequence: Option<DiffZone>,
) -> Result<Option<PendingQueueDiff>>
fn prepare_diff( &self, diff: QueueDiffWithMessages<V>, block_id_short: BlockIdShort, diff_hash: &HashBytes, statistics: DiffStatistics, check_sequence: Option<DiffZone>, ) -> Result<Option<PendingQueueDiff>>
Prepare diff for applying to queue. Returns transaction that should be committed later.
Returns None if diff is already applied (duplicate).
Source§fn apply_diff(
&self,
diff: QueueDiffWithMessages<V>,
block_id_short: BlockIdShort,
diff_hash: &HashBytes,
statistics: DiffStatistics,
check_sequence: Option<DiffZone>,
) -> Result<()>
fn apply_diff( &self, diff: QueueDiffWithMessages<V>, block_id_short: BlockIdShort, diff_hash: &HashBytes, statistics: DiffStatistics, check_sequence: Option<DiffZone>, ) -> Result<()>
Apply diff by storing it to the queue uncommitted zone (waiting for the operation to complete)
Source§fn commit_diff(
&self,
mc_top_blocks: Vec<TopBlockIdUpdated>,
partitions: &FastHashSet<QueuePartitionIdx>,
) -> Result<()>
fn commit_diff( &self, mc_top_blocks: Vec<TopBlockIdUpdated>, partitions: &FastHashSet<QueuePartitionIdx>, ) -> Result<()>
Commit previously applied diffs, updating commit pointers (waiting for the operation to complete)
fn clear_uncommitted_state(&self, top_shards: &[ShardIdent]) -> Result<()>
Source§fn get_diff_info(
&self,
shard_ident: &ShardIdent,
seqno: u32,
zone: DiffZone,
) -> Result<Option<DiffInfo>>
fn get_diff_info( &self, shard_ident: &ShardIdent, seqno: u32, zone: DiffZone, ) -> Result<Option<DiffInfo>>
Get diff for the given block from committed and/or uncommitted zone
Source§fn is_diff_exists(&self, block_id_short: &BlockIdShort) -> Result<bool>
fn is_diff_exists(&self, block_id_short: &BlockIdShort) -> Result<bool>
Check if diff exists in state
Source§fn get_last_committed_mc_block_id(&self) -> Result<Option<BlockId>>
fn get_last_committed_mc_block_id(&self) -> Result<Option<BlockId>>
Get mc block id on which the queue was committed.
Returns None if queue was not committed
Source§fn get_diffs_tail_len(&self, shard_ident: &ShardIdent, from: &QueueKey) -> u32
fn get_diffs_tail_len(&self, shard_ident: &ShardIdent, from: &QueueKey) -> u32
Get diffs tail len.
from - start key for the tail. Diff with max_message == from will be excluded from the tailSource§fn load_separated_diff_statistics(
&self,
partitions: &FastHashSet<QueuePartitionIdx>,
range: &QueueShardBoundedRange,
) -> Result<SeparatedStatisticsByPartitions>
fn load_separated_diff_statistics( &self, partitions: &FastHashSet<QueuePartitionIdx>, range: &QueueShardBoundedRange, ) -> Result<SeparatedStatisticsByPartitions>
Load separated diff statistics for the specified partitions and range.
range.from = diff with max_message == range.from will be excluded in statistics;
range.to = diff with max_message == range.to will be included in statisticsSource§fn get_router_and_statistics(
&self,
block_id_short: &BlockIdShort,
diff_info: DiffInfo,
partition: QueuePartitionIdx,
) -> Result<(PartitionRouter, DiffStatistics)>
fn get_router_and_statistics( &self, block_id_short: &BlockIdShort, diff_info: DiffInfo, partition: QueuePartitionIdx, ) -> Result<(PartitionRouter, DiffStatistics)>
Get partition router and statistics for the specified block
Auto Trait Implementations§
impl<V> Freeze for MessageQueueAdapterStdImpl<V>
impl<V> !RefUnwindSafe for MessageQueueAdapterStdImpl<V>
impl<V> Send for MessageQueueAdapterStdImpl<V>
impl<V> Sync for MessageQueueAdapterStdImpl<V>
impl<V> Unpin for MessageQueueAdapterStdImpl<V>where
V: Unpin,
impl<V> UnsafeUnpin for MessageQueueAdapterStdImpl<V>
impl<V> !UnwindSafe for MessageQueueAdapterStdImpl<V>
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