public class TermReader
extends java.lang.Object
Note: Reading from the term is thread safe, but each thread needs its own instance of this class.
| Constructor and Description |
|---|
TermReader() |
| Modifier and Type | Method and Description |
|---|---|
static int |
fragmentsRead(long readOutcome)
The number of fragments that have been read.
|
static int |
offset(long readOutcome)
The offset up to which the term has progressed.
|
static long |
pack(int offset,
int fragmentsRead)
Pack the values for fragmentsRead and offset into a long for returning on the stack.
|
static long |
read(org.agrona.concurrent.UnsafeBuffer termBuffer,
int offset,
FragmentHandler handler,
int fragmentsLimit,
Header header,
org.agrona.ErrorHandler errorHandler)
Reads data from a term in a log buffer.
|
public static long read(org.agrona.concurrent.UnsafeBuffer termBuffer,
int offset,
FragmentHandler handler,
int fragmentsLimit,
Header header,
org.agrona.ErrorHandler errorHandler)
termBuffer - to be read for fragments.offset - offset within the buffer that the read should begin.handler - the handler for data that has been readfragmentsLimit - limit the number of fragments read.header - to be used for mapping over the header for a given fragment.errorHandler - to be notified if an error occurs during the callback.public static long pack(int offset,
int fragmentsRead)
offset - value to be packed.fragmentsRead - value to be packed.public static int fragmentsRead(long readOutcome)
readOutcome - into which the fragments read value has been packed.public static int offset(long readOutcome)
readOutcome - into which the offset value has been packed.Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.