MCPcopy
hub / github.com/dropbox/godropbox / EventReader

Interface EventReader

database/binlog/event_reader.go:19–41  ·  view source on GitHub ↗

EventReader is the common reader interface for all mysql binary log event streams. NOTE: The EventReader interface purposely does not support jumping to a specific log position offset because skipping is very error prone. WaitForEvent is threadsafe; none of the other methods are threadsafe.

Source from the content-addressed store, hash-verified

17// jumping to a specific log position offset because skipping is very error
18// prone. WaitForEvent is threadsafe; none of the other methods are threadsafe.
19type EventReader interface {
20 // NextEvent returns the next available event from the event stream.
21 NextEvent() (Event, error)
22
23 // Close closes the reader. Subsequent calls to NextEvent will return
24 // an error.
25 Close() error
26
27 // peekHeaderBytes returns up to sizeOfBasicV4EventHeader number of bytes
28 // from the event header. This is used for checking binlog magic marker
29 // and format version at the beginning of the event stream.
30 peekHeaderBytes(numBytes int) ([]byte, error)
31
32 // consumeHeaderBytes will discard up to sizeOfBasicV4EventHeader number
33 // of bytes from the event header. This is used for throwing away the
34 // binlog magic marker at the beginning of the event stream.
35 consumeHeaderBytes(numBytes int) error
36
37 // nextEventEndPosition returns the next event's end position relative to
38 // the source io stream. Note the value is an underestimate when the
39 // next event's common header is not yet parsed.
40 nextEventEndPosition() int64
41}
42
43// When tailing logs on a mysql box, there's a potential race conditions where
44// the rotate event is written, but a new log file is not created yet. It's

Callers 35

TestBasicMethod · 0.65
TestTableWithMetadataMethod · 0.65
TestAllColumnTypesMethod · 0.65
NextEventMethod · 0.65
NextEventMethod · 0.65
TestStopEventMethod · 0.65
Test55FDEMethod · 0.65
Test56FDEMethod · 0.65
NextEventMethod · 0.65
CloseMethod · 0.65
TestCloseMethod · 0.65
CloseMethod · 0.65

Implementers 5

logStreamV4EventReaderdatabase/binlog/log_stream_event_reade
logFileV4EventReaderdatabase/binlog/log_file_event_reader.
MockMultifileReaderdatabase/binlog/mock_multifile_reader.
parsedV4EventReaderdatabase/binlog/parsed_event_reader.go
rawV4EventReaderdatabase/binlog/raw_event_reader.go

Calls

no outgoing calls

Tested by

no test coverage detected