Package io.aeron.cluster.client
Class EgressPoller
java.lang.Object
io.aeron.cluster.client.EgressPoller
- All Implemented Interfaces:
ControlledFragmentHandler
Poller for the egress from a cluster to capture administration message details.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.aeron.logbuffer.ControlledFragmentHandler
ControlledFragmentHandler.Action -
Constructor Summary
ConstructorsConstructorDescriptionEgressPoller(Subscription subscription, int fragmentLimit) Construct a poller on the egress subscription. -
Method Summary
Modifier and TypeMethodDescriptionlongCluster session id of the last polled event orAeron.NULL_VALUEif poll returned nothing.longCorrelation id of the last polled event orAeron.NULL_VALUEif poll returned nothing.detail()Get the detail returned from the last session event.Imagefor the egress response from the cluster which can be used for connection tracking.byte[]Get the encoded challenge in the last challenge.io.aeron.cluster.codecs.EventCodeGet the event code returned from the last session event.booleanWas last message a challenge or not?booleanHas the last polling action received a complete event?longLeader heartbeat timeout of the last polled event orAeron.NULL_VALUEif not available.intLeader cluster member id of the last polled event orAeron.NULL_VALUEif poll returned nothing.longLeadership term id of the last polled event orAeron.NULL_VALUEif poll returned nothing.onFragment(DirectBuffer buffer, int offset, int length, Header header) Callback for handling fragments of data being read from a log.intpoll()Reset last captured value and poll the egress subscription for output.Get theSubscriptionused for polling events.intGet the template id of the last received event.intversion()Version response from the server in semantic version form.
-
Constructor Details
-
EgressPoller
Construct a poller on the egress subscription.- Parameters:
subscription- for egress from the cluster.fragmentLimit- for each poll operation.
-
-
Method Details
-
subscription
Get theSubscriptionused for polling events.- Returns:
- the
Subscriptionused for polling events.
-
egressImage
Imagefor the egress response from the cluster which can be used for connection tracking.- Returns:
Imagefor the egress response from the cluster which can be used for connection tracking.
-
templateId
public int templateId()Get the template id of the last received event.- Returns:
- the template id of the last received event.
-
clusterSessionId
public long clusterSessionId()Cluster session id of the last polled event orAeron.NULL_VALUEif poll returned nothing.- Returns:
- cluster session id of the last polled event or
Aeron.NULL_VALUEif not returned.
-
correlationId
public long correlationId()Correlation id of the last polled event orAeron.NULL_VALUEif poll returned nothing.- Returns:
- correlation id of the last polled event or
Aeron.NULL_VALUEif not returned.
-
leadershipTermId
public long leadershipTermId()Leadership term id of the last polled event orAeron.NULL_VALUEif poll returned nothing.- Returns:
- leadership term id of the last polled event or
Aeron.NULL_VALUEif not returned.
-
leaderMemberId
public int leaderMemberId()Leader cluster member id of the last polled event orAeron.NULL_VALUEif poll returned nothing.- Returns:
- leader cluster member id of the last polled event or
Aeron.NULL_VALUEif poll returned nothing.
-
eventCode
public io.aeron.cluster.codecs.EventCode eventCode()Get the event code returned from the last session event.- Returns:
- the event code returned from the last session event.
-
version
public int version()Version response from the server in semantic version form.- Returns:
- response from the server in semantic version form.
-
leaderHeartbeatTimeoutNs
public long leaderHeartbeatTimeoutNs()Leader heartbeat timeout of the last polled event orAeron.NULL_VALUEif not available.- Returns:
- leader heartbeat timeout of the last polled event or
Aeron.NULL_VALUEif not available.
-
detail
Get the detail returned from the last session event.- Returns:
- the detail returned from the last session event.
-
encodedChallenge
public byte[] encodedChallenge()Get the encoded challenge in the last challenge.- Returns:
- the encoded challenge in the last challenge or null if last message was not a challenge.
-
isPollComplete
public boolean isPollComplete()Has the last polling action received a complete event?- Returns:
- true if the last polling action received a complete event.
-
isChallenged
public boolean isChallenged()Was last message a challenge or not?- Returns:
- true if last message was a challenge or false if not.
-
poll
public int poll()Reset last captured value and poll the egress subscription for output.- Returns:
- number of fragments consumed.
-
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.
-