public class ExclusiveBufferClaim
extends java.lang.Object
ExclusiveBufferClaims offer additional functionality over standard BufferClaims in that the header
can be manipulated for setting flags and type. This allows the user to implement things such as their own
fragmentation policy.
The claimed space is in buffer() between offset() and offset() + length().
When the buffer is filled with message data, use commit() to make it available to subscribers.
If the claimed space is no longer required it can be aborted by calling abort().
Data Frame| Constructor and Description |
|---|
ExclusiveBufferClaim() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort a claim of the message space to the log buffer so that the log can progress by ignoring this claim.
|
org.agrona.MutableDirectBuffer |
buffer()
The referenced buffer to be used.
|
void |
commit()
Commit the message to the log buffer so that is it available to subscribers.
|
byte |
flags()
Get the value of the flags field.
|
ExclusiveBufferClaim |
flags(byte flags)
Set the value of the header flags field.
|
int |
headerType()
Get the value of the header type field.
|
ExclusiveBufferClaim |
headerType(int type)
Set the value of the header type field.
|
int |
length()
The length of the claimed range in the buffer.
|
int |
offset()
The offset in the buffer at which the claimed range begins.
|
long |
reservedValue()
Get the value stored in the reserve space at the end of a data frame header.
|
ExclusiveBufferClaim |
reservedValue(long value)
Write the provided value into the reserved space at the end of the data frame header.
|
void |
wrap(org.agrona.concurrent.AtomicBuffer buffer,
int offset,
int length)
Wrap a region of an underlying log buffer so can can represent a claimed space for use by a publisher.
|
public void wrap(org.agrona.concurrent.AtomicBuffer buffer,
int offset,
int length)
buffer - to be wrapped.offset - at which the claimed region begins including space for the header.length - length of the underlying claimed region including space for the header.public org.agrona.MutableDirectBuffer buffer()
public int offset()
public int length()
public byte flags()
DataHeaderFlyweightpublic ExclusiveBufferClaim flags(byte flags)
flags - value to be set in the header.DataHeaderFlyweightpublic int headerType()
DataHeaderFlyweightpublic ExclusiveBufferClaim headerType(int type)
type - value to be set in the header.DataHeaderFlyweightpublic long reservedValue()
ByteOrder.LITTLE_ENDIAN format.DataHeaderFlyweightpublic ExclusiveBufferClaim reservedValue(long value)
ByteOrder.LITTLE_ENDIAN format.value - to be stored in the reserve space at the end of a data frame header.DataHeaderFlyweightpublic void commit()
public void abort()
Copyright © 2014-2017 Real Logic Ltd. All Rights Reserved.