public class CounterMessageFlyweight extends CorrelatedMessageFlyweight
Note: Layout should be SBE 2.0 compliant so that the label length is aligned.
buffer, CLIENT_ID_FIELD_OFFSET, CORRELATION_ID_FIELD_OFFSET, LENGTH, offset
Constructor and Description |
---|
CounterMessageFlyweight() |
Modifier and Type | Method and Description |
---|---|
CounterMessageFlyweight |
keyBuffer(org.agrona.DirectBuffer keyBuffer,
int keyOffset,
int keyLength)
Fill the key buffer.
|
int |
keyBufferLength()
Length of the key buffer in bytes
|
int |
keyBufferOffset()
Offset of the key buffer
|
CounterMessageFlyweight |
label(java.lang.String label)
Fill the label.
|
CounterMessageFlyweight |
labelBuffer(org.agrona.DirectBuffer labelBuffer,
int labelOffset,
int labelLength)
Fill the label buffer.
|
int |
labelBufferLength()
Length of label buffer in bytes.
|
int |
labelBufferOffset()
Offset of label buffer.
|
int |
length()
Get the length of the current message
|
int |
typeId()
return type id field
|
CounterMessageFlyweight |
typeId(long typeId)
set counter type id field
|
clientId, clientId, correlationId, correlationId, wrap
public int typeId()
public CounterMessageFlyweight typeId(long typeId)
typeId
- field valuepublic int keyBufferOffset()
public int keyBufferLength()
public CounterMessageFlyweight keyBuffer(org.agrona.DirectBuffer keyBuffer, int keyOffset, int keyLength)
keyBuffer
- containing the optional key for the counter.keyOffset
- within the keyBuffer at which the key begins.keyLength
- of the key in the keyBuffer.public int labelBufferOffset()
public int labelBufferLength()
public CounterMessageFlyweight labelBuffer(org.agrona.DirectBuffer labelBuffer, int labelOffset, int labelLength)
labelBuffer
- containing the mandatory label for the counter.labelOffset
- within the labelBuffer at which the label begins.labelLength
- of the label in the labelBuffer.public CounterMessageFlyweight label(java.lang.String label)
label
- for the counterpublic int length()
NB: must be called after the data is written in order to be accurate.
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.