Package io.aeron.driver.status
Class StreamCounter
java.lang.Object
io.aeron.driver.status.StreamCounter
Allocates counters on a stream of messages.
Positions tracked in bytes include:
PublisherPos: Highest position on aPublicationreached for offers and claims as an approximation which is sampled once per second.PublisherLimit: Limit for flow controlling aPublicationoffers and claims.SenderPos: Highest position on aPublicationstream sent to the media.SenderLimit: Limit for flow controlling aSenderof a stream.ReceiverHwm: Highest position observed by theReceiverwhen rebuilding anImageof a stream.ReceiverPos: Highest contiguous position rebuilt by theReceiveron anImageof a stream.SubscriberPos: Consumption position on anImageof a stream by an individual Subscriber.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOffset in the key metadata for the channel of the counter.static final intThe maximum length in bytes of the encoded channel identity.static final intOffset in the key metadata for the registration id of the counter.static final intOffset in the key metadata for the session id of the counter.static final intOffset in the key metadata for the stream id of the counter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intallocateCounterId(MutableDirectBuffer tempBuffer, String name, int typeId, CountersManager countersManager, long clientId, long registrationId, int sessionId, int streamId, String channel, long joinPosition) Allocate a counter id for tracking a position on a stream of messages.
-
Field Details
-
REGISTRATION_ID_OFFSET
public static final int REGISTRATION_ID_OFFSETOffset in the key metadata for the registration id of the counter.- See Also:
-
SESSION_ID_OFFSET
public static final int SESSION_ID_OFFSETOffset in the key metadata for the session id of the counter.- See Also:
-
STREAM_ID_OFFSET
public static final int STREAM_ID_OFFSETOffset in the key metadata for the stream id of the counter.- See Also:
-
CHANNEL_OFFSET
public static final int CHANNEL_OFFSETOffset in the key metadata for the channel of the counter.- See Also:
-
MAX_CHANNEL_LENGTH
public static final int MAX_CHANNEL_LENGTHThe maximum length in bytes of the encoded channel identity.- See Also:
-
-
Constructor Details
-
StreamCounter
public StreamCounter()
-
-
Method Details
-
allocateCounterId
public static int allocateCounterId(MutableDirectBuffer tempBuffer, String name, int typeId, CountersManager countersManager, long clientId, long registrationId, int sessionId, int streamId, String channel, long joinPosition) Allocate a counter id for tracking a position on a stream of messages.- Parameters:
tempBuffer- to be used for labels and key.name- of the counter for the label.typeId- of the counter for classification.countersManager- from which the underlying storage is allocated.clientId- to set as counter owner.registrationId- to be associated with the counter.sessionId- for the stream of messages.streamId- for the stream of messages.channel- for the stream of messages.joinPosition- relevant for `sub-pos` only.- Returns:
- the id of the allocated counter.
-