Package io.aeron.archive.client
Class RecordingEventsAdapter
java.lang.Object
io.aeron.archive.client.RecordingEventsAdapter
- All Implemented Interfaces:
FragmentHandler
Encapsulate the polling, decoding, and dispatching of recording events.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordingEventsAdapter(RecordingEventsListener listener, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for recording events. -
Method Summary
Modifier and TypeMethodDescriptionvoidonFragment(DirectBuffer buffer, int offset, int length, Header header) Callback for handling fragments of data being read from a log.intpoll()Poll for recording events and dispatch them to theRecordingEventsListenerfor this instance.
-
Constructor Details
-
RecordingEventsAdapter
public RecordingEventsAdapter(RecordingEventsListener listener, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for recording events.- Parameters:
listener- to which events are dispatched.subscription- to poll for new events.fragmentLimit- to apply for each polling operation.
-
-
Method Details
-
poll
public int poll()Poll for recording events and dispatch them to theRecordingEventsListenerfor this instance.- Returns:
- the number of fragments read during the operation. Zero if no events are available.
-
onFragment
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 interfaceFragmentHandler- Parameters:
buffer- containing the data.offset- at which the data begins.length- of the data in bytes.header- representing the metadata for the data.
-