Package io.aeron.archive.client
Class RecordingEventsPoller
java.lang.Object
io.aeron.archive.client.RecordingEventsPoller
- All Implemented Interfaces:
ControlledFragmentHandler
Encapsulate the polling and decoding of recording events.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.aeron.logbuffer.ControlledFragmentHandler
ControlledFragmentHandler.Action -
Constructor Summary
ConstructorsConstructorDescriptionRecordingEventsPoller(Subscription subscription) Create a poller for a given subscription to an archive for recording events. -
Method Summary
Modifier and TypeMethodDescriptionbooleanHas the last polling action received a complete message?onFragment(DirectBuffer buffer, int offset, int length, Header header) Callback for handling fragments of data being read from a log.intpoll()Poll for recording events.longGet the recording id of the last received event.longGet the current recording position.longGet the position the recording started at.longGet the position the recording stopped at.intGet the template id of the last received message.
-
Constructor Details
-
RecordingEventsPoller
Create a poller for a given subscription to an archive for recording events.- Parameters:
subscription- to poll for new events.
-
-
Method Details
-
poll
public int poll()Poll for recording events.- Returns:
- the number of fragments read during the operation. Zero if no events are available.
-
isPollComplete
public boolean isPollComplete()Has the last polling action received a complete message?- Returns:
- true of the last polling action received a complete message?
-
templateId
public int templateId()Get the template id of the last received message.- Returns:
- the template id of the last received message.
-
recordingId
public long recordingId()Get the recording id of the last received event.- Returns:
- the recording id of the last received event.
-
recordingStartPosition
public long recordingStartPosition()Get the position the recording started at.- Returns:
- the position the recording started at.
-
recordingPosition
public long recordingPosition()Get the current recording position.- Returns:
- the current recording position.
-
recordingStopPosition
public long recordingStopPosition()Get the position the recording stopped at.- Returns:
- the position the recording stopped at.
-
onFragment
public ControlledFragmentHandler.Action onFragment(DirectBuffer buffer, int offset, int length, Header header) Callback for handling fragments of data being read from a log.Within this callback reentrant calls to the
Aeronclient are not permitted and will result in undefined behaviour.- Specified by:
onFragmentin interfaceControlledFragmentHandler- Parameters:
buffer- containing the data.offset- at which the data begins.length- of the data in bytes.header- representing the metadata for the data.- Returns:
- The action to be taken with regard to the stream position after the callback.
-