Interface FragmentHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface FragmentHandler
Consume fragments from the buffer.

Note that the handler is not aware of fragment batches.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    fragment consumed successfully *
    static final int
    fragment consumed with failure *
    static final int
    fragment not consumed *
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    onFragment(org.agrona.DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed)
    Consume the message from the given buffer.
  • Field Details

    • CONSUME_FRAGMENT_RESULT

      static final int CONSUME_FRAGMENT_RESULT
      fragment consumed successfully *
      See Also:
    • POSTPONE_FRAGMENT_RESULT

      static final int POSTPONE_FRAGMENT_RESULT
      fragment not consumed *
      See Also:
    • FAILED_FRAGMENT_RESULT

      static final int FAILED_FRAGMENT_RESULT
      fragment consumed with failure *
      See Also:
  • Method Details

    • onFragment

      int onFragment(org.agrona.DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed)
      Consume the message from the given buffer.
      Parameters:
      buffer - the buffer which contains the message
      offset - the message offset (i.e. the start position of the message in the buffer)
      length - the message length
      streamId - the fragments stream id
      isMarkedFailed - true if a handler consumed this message previously with failure (i.e. result was FAILED_FRAGMENT_RESULT).
      Returns:
      the consume result which should be one of CONSUME_FRAGMENT_RESULT, FAILED_FRAGMENT_RESULT or POSTPONE_FRAGMENT_RESULT.