public class StreamPositionCounter
extends java.lang.Object
UnsafeBufferPosition counters on a stream of messages. Positions tracked in bytes include:
PublisherLimit: Limit for flow controlling a Publication steam.SenderPos: Highest position on a Publication stream sent to the media.SenderLimit: Limit for flow controlling a Sender of a stream.ReceiverHwm: Highest position by the Receiver when rebuilding an Image of a stream.SubscriberPos: Consumption position in an Image of a stream for each Subscriber.| Modifier and Type | Field and Description |
|---|---|
static int |
CHANNEL_OFFSET
Offset in the key meta data for the channel of the counter.
|
static int |
MAX_CHANNEL_LENGTH
The maximum length in bytes of the encoded channel identity.
|
static int |
REGISTRATION_ID_OFFSET
Offset in the key meta data for the registration id of the counter.
|
static int |
SESSION_ID_OFFSET
Offset in the key meta data for the session id of the counter.
|
static int |
STREAM_ID_OFFSET
Offset in the key meta data for the stream id of the counter.
|
| Constructor and Description |
|---|
StreamPositionCounter() |
| Modifier and Type | Method and Description |
|---|---|
static org.agrona.concurrent.status.UnsafeBufferPosition |
allocate(java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel)
Allocate a counter for tracking a position on a stream of messages.
|
static org.agrona.concurrent.status.UnsafeBufferPosition |
allocate(java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel,
java.lang.String suffix)
Allocate a counter for tracking a position on a stream of messages.
|
static java.lang.String |
labelName(int typeId)
Return the label name for a counter type identifier.
|
public static final int REGISTRATION_ID_OFFSET
public static final int SESSION_ID_OFFSET
public static final int STREAM_ID_OFFSET
public static final int CHANNEL_OFFSET
public static final int MAX_CHANNEL_LENGTH
public static org.agrona.concurrent.status.UnsafeBufferPosition allocate(java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel)
name - of the counter for the label.typeId - of the counter for classification.countersManager - from which to allocated the underlying storage.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.UnsafeBufferPosition for tracking the stream.public static org.agrona.concurrent.status.UnsafeBufferPosition allocate(java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel,
java.lang.String suffix)
name - of the counter for the label.typeId - of the counter for classification.countersManager - from which to allocated the underlying storage.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.suffix - for the label.UnsafeBufferPosition for tracking the stream.public static java.lang.String labelName(int typeId)
typeId - of the counter.Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.