public class BufferClaim
extends java.lang.Object
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().
Publication.tryClaim(int, BufferClaim)| Modifier and Type | Field and Description |
|---|---|
protected org.agrona.concurrent.UnsafeBuffer |
buffer |
| Constructor and Description |
|---|
BufferClaim() |
| 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.
|
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.
|
BufferClaim |
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 final 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 final org.agrona.MutableDirectBuffer buffer()
public final int offset()
public final int length()
public final long reservedValue()
Note: The value is in ByteOrder.LITTLE_ENDIAN format.
DataHeaderFlyweightpublic BufferClaim reservedValue(long value)
Note: The value will be written in ByteOrder.LITTLE_ENDIAN format.
value - to be stored in the reserve space at the end of a data frame header.DataHeaderFlyweightpublic final void commit()
public final void abort()
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.