CachedMessageBlock Class

Definition

CachedMessageBlock is a block of tightly packed structures containing tracking data for cached messages. This data is tightly packed to reduced GC pressure. The tracking data is used by the queue cache to walk the cache serving ordered queue messages by stream.

public class CachedMessageBlock : Orleans.Providers.Streams.Common.PooledResource<Orleans.Providers.Streams.Common.CachedMessageBlock>
type CachedMessageBlock = class
    inherit PooledResource<CachedMessageBlock>
Public Class CachedMessageBlock
Inherits PooledResource(Of CachedMessageBlock)
Inheritance

Constructors

CachedMessageBlock(Int32)

Block of cached messages.

Properties

HasCapacity

Gets a value indicating whether more messages can be added to the block.

IsEmpty

Gets a value indicating whether this block is empty.

Item[Int32]

Access the cached message at the provided index.

ItemCount

Gets the number of messages in this block.

NewestMessage

Gets the newest message in this block.

NewestMessageIndex

Gets the index of most recent message added to the block.

Node

Linked list node, so this message block can be kept in a linked list.

OldestMessage

Gets the oldest message in the block.

OldestMessageIndex

Gets the index of the oldest message in this block.

Pool

Gets the pool to return this resource to upon disposal. A pool must set this property upon resource allocation.

(Inherited from PooledResource<T>)

Methods

Add(CachedMessage)

Add a message from the queue to the block. Converts the queue message to a cached message and stores it at the end of the block.

Dispose()

Returns item to pool.

(Inherited from PooledResource<T>)
GetIndexOfFirstMessageLessThanOrEqualTo(StreamSequenceToken)

Gets the index of the first message in this block that has a sequence token at or before the provided token

GetNewestSequenceToken(ICacheDataAdapter)

Gets the sequence token of the newest message in this block

GetOldestSequenceToken(ICacheDataAdapter)

Gets the sequence token of the oldest message in this block

GetSequenceToken(Int32, ICacheDataAdapter)

Gets the sequence token of the cached message a the provided index

OnResetState()

Resets this blocks state to that of an empty block.

Remove()

Removes a message from the start of the block (oldest data).

SignalPurge()

If this object is to be used in a fixed size object pool, this call should be overridden with the purge implementation that returns the object to the pool.

(Inherited from PooledResource<T>)
TryFindFirstMessage(IStreamIdentity, ICacheDataAdapter, Int32)

Tries to find the first message in the block that is part of the provided stream.

TryFindFirstMessage(StreamId, ICacheDataAdapter, Int32)

Tries to find the first message in the block that is part of the provided stream.

TryFindNextMessage(Int32, IStreamIdentity, ICacheDataAdapter, Int32)

Tries to get the next message from the provided stream, starting at the start index.

TryFindNextMessage(Int32, StreamId, ICacheDataAdapter, Int32)

Tries to get the next message from the provided stream, starting at the start index.

Applies to