Documentation ¶
Index ¶
- Constants
- func BoundedRead(termBuffer *atomic.Buffer, termOffset int32, offsetLimit int32, ...) (int32, int)
- func Read(termBuffer *atomic.Buffer, termOffset int32, handler FragmentHandler, ...) (int32, int)
- type Appender
- func (appender *Appender) AppendFragmentedMessage(srcBuffer *atomic.Buffer, srcOffset int32, length int32, ...) (resultingOffset int64, termID int32)
- func (appender *Appender) AppendFragmentedMessage2(srcBufferOne *atomic.Buffer, srcOffsetOne int32, lengthOne int32, ...) (resultingOffset int64, termID int32)
- func (appender *Appender) AppendUnfragmentedMessage(srcBuffer *atomic.Buffer, srcOffset int32, length int32, ...) (resultingOffset int64, termID int32)
- func (appender *Appender) AppendUnfragmentedMessage2(srcBufferOne *atomic.Buffer, srcOffsetOne int32, lengthOne int32, ...) (resultingOffset int64, termID int32)
- func (appender *Appender) Claim(length int32, claim *logbuffer.Claim) (resultingOffset int64, termID int32)
- func (appender *Appender) RawTail() int64
- func (appender *Appender) SetRawTail(v int64)
- func (appender *Appender) SetTailTermID(termID int32)
- type ControlledFragmentHandler
- type ControlledPollAction
- type FragmentHandler
- type MockFragmentHandler
- type ReservedValueSupplier
Constants ¶
const ( // AppenderTripped is returned when the end of the term has been reached and buffer roll was done AppenderTripped int64 = -1 // AppenderFailed is returned when appending is not possible due to position being outside of the term. ?? AppenderFailed int64 = -2 )
const ( // ControlledPollActionAbort aborts the current polling operation and do not // advance the position for this fragment. ControlledPollActionAbort ControlledPollAction = 1 // ControlledPollActionBreak breaks from the current polling operation and // commit the position as of the end of the current fragment being handled. ControlledPollActionBreak = 2 // ControlledPollActionCommit continues processing but commit the position as of // the end of the current fragment so that flow control is applied to this // point. ControlledPollActionCommit = 3 // ControlledPollActionContinue continues processing until fragment limit or no // fragments with position commit at end of poll as in onFragment ControlledPollActionContinue = 4 )
Variables ¶
This section is empty.
Functions ¶
func BoundedRead ¶
func BoundedRead(termBuffer *atomic.Buffer, termOffset int32, offsetLimit int32, handler FragmentHandler, fragmentLimit int, header *logbuffer.Header) (int32, int)
BoundedRead will attempt to read frames from the term up to the specified offsetLimit. Method will return a tuple of new term offset and number of fragments read
func Read ¶
func Read(termBuffer *atomic.Buffer, termOffset int32, handler FragmentHandler, fragmentLimit int, header *logbuffer.Header) (int32, int)
Read will attempt to read the next frame from the term and invoke the callback if successful. Method will return a tuple of new term offset and number of fragments read
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
Appender type is the term writer
func MakeAppender ¶
func MakeAppender(logBuffers *logbuffer.LogBuffers, partitionIndex int) *Appender
MakeAppender is the factory function for term Appenders
func (*Appender) AppendFragmentedMessage ¶
func (appender *Appender) AppendFragmentedMessage(srcBuffer *atomic.Buffer, srcOffset int32, length int32, maxPayloadLength int32, reservedValueSupplier ReservedValueSupplier) (resultingOffset int64, termID int32)
AppendFragmentedMessage appends a message greater than frame length as a batch of fragments
func (*Appender) AppendFragmentedMessage2 ¶
func (appender *Appender) AppendFragmentedMessage2( srcBufferOne *atomic.Buffer, srcOffsetOne int32, lengthOne int32, srcBufferTwo *atomic.Buffer, srcOffsetTwo int32, lengthTwo int32, maxPayloadLength int32, reservedValueSupplier ReservedValueSupplier, ) (resultingOffset int64, termID int32)
AppendFragmentedMessage2 appends the given pair of buffers (with combined length greater than max frame length) as a batch of fragments
func (*Appender) AppendUnfragmentedMessage ¶
func (appender *Appender) AppendUnfragmentedMessage(srcBuffer *atomic.Buffer, srcOffset int32, length int32, reservedValueSupplier ReservedValueSupplier) (resultingOffset int64, termID int32)
AppendUnfragmentedMessage appends an unfragmented message in a single frame to the term
func (*Appender) AppendUnfragmentedMessage2 ¶
func (appender *Appender) AppendUnfragmentedMessage2( srcBufferOne *atomic.Buffer, srcOffsetOne int32, lengthOne int32, srcBufferTwo *atomic.Buffer, srcOffsetTwo int32, lengthTwo int32, reservedValueSupplier ReservedValueSupplier, ) (resultingOffset int64, termID int32)
AppendUnfragmentedMessage2 appends the given pair of buffers as an unfragmented message in a single frame to the term
func (*Appender) Claim ¶
func (appender *Appender) Claim(length int32, claim *logbuffer.Claim) (resultingOffset int64, termID int32)
Claim is the interface for using Buffer Claims for zero copy sends
func (*Appender) RawTail ¶
RawTail is the accessor to the raw value of the tail offset used by Publication
func (*Appender) SetRawTail ¶
SetRawTail sets the raw value of the tail. It should not be used outside of testing
func (*Appender) SetTailTermID ¶
type ControlledPollAction ¶
type ControlledPollAction int8
type FragmentHandler ¶
type FragmentHandler func(buffer *atomic.Buffer, offset int32, length int32, header *logbuffer.Header)
FragmentHandler is the main callback interface for received data
type MockFragmentHandler ¶
MockFragmentHandler is an autogenerated mock type for the FragmentHandler type
func NewMockFragmentHandler ¶
func NewMockFragmentHandler(t mockConstructorTestingTNewMockFragmentHandler) *MockFragmentHandler
NewMockFragmentHandler creates a new instance of MockFragmentHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type ReservedValueSupplier ¶
ReservedValueSupplier is the type definition for a provider of user supplied header data