Class EgressPoller

java.lang.Object
io.aeron.cluster.client.EgressPoller
All Implemented Interfaces:
ControlledFragmentHandler

public final class EgressPoller extends Object implements ControlledFragmentHandler
Poller for the egress from a cluster to capture administration message details.
  • Constructor Details

    • EgressPoller

      public EgressPoller(Subscription subscription, int fragmentLimit)
      Construct a poller on the egress subscription.
      Parameters:
      subscription - for egress from the cluster.
      fragmentLimit - for each poll operation.
  • Method Details

    • subscription

      public Subscription subscription()
      Get the Subscription used for polling events.
      Returns:
      the Subscription used for polling events.
    • egressImage

      public Image egressImage()
      Image for the egress response from the cluster which can be used for connection tracking.
      Returns:
      Image for 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 or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      cluster session id of the last polled event or Aeron.NULL_VALUE if not returned.
    • correlationId

      public long correlationId()
      Correlation id of the last polled event or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      correlation id of the last polled event or Aeron.NULL_VALUE if not returned.
    • leadershipTermId

      public long leadershipTermId()
      Leadership term id of the last polled event or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      leadership term id of the last polled event or Aeron.NULL_VALUE if not returned.
    • leaderMemberId

      public int leaderMemberId()
      Leader cluster member id of the last polled event or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      leader cluster member id of the last polled event or Aeron.NULL_VALUE if 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 or Aeron.NULL_VALUE if not available.
      Returns:
      leader heartbeat timeout of the last polled event or Aeron.NULL_VALUE if not available.
    • detail

      public String 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 Aeron client are not permitted and will result in undefined behaviour.

      Specified by:
      onFragment in interface ControlledFragmentHandler
      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.