public class TermReader
extends java.lang.Object
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 termOffset,
FragmentHandler handler,
int fragmentsLimit,
Header header,
org.agrona.ErrorHandler errorHandler)
Reads data from a term in a log buffer.
|
static int |
read(org.agrona.concurrent.UnsafeBuffer termBuffer,
int termOffset,
FragmentHandler handler,
int fragmentsLimit,
Header header,
org.agrona.ErrorHandler errorHandler,
long currentPosition,
org.agrona.concurrent.status.Position subscriberPosition)
Reads data from a term in a log buffer and updates a passed
Position so progress is not lost in the
event of an exception. |
public static int read(org.agrona.concurrent.UnsafeBuffer termBuffer, int termOffset, FragmentHandler handler, int fragmentsLimit, Header header, org.agrona.ErrorHandler errorHandler, long currentPosition, org.agrona.concurrent.status.Position subscriberPosition)
Position
so progress is not lost in the
event of an exception.termBuffer
- to be read for fragments.termOffset
- 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.currentPosition
- prior to reading further fragmentssubscriberPosition
- to be updated after reading with new positionpublic static long read(org.agrona.concurrent.UnsafeBuffer termBuffer, int termOffset, FragmentHandler handler, int fragmentsLimit, Header header, org.agrona.ErrorHandler errorHandler)
termBuffer
- to be read for fragments.termOffset
- 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-2018 Real Logic Ltd. All Rights Reserved.