-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harvester Cleanup and FileEvent #2090
Conversation
ruflin
commented
Jul 25, 2016
•
edited
Loading
edited
- Rename FileEvent to Event
- Remove double information between FileEvent and State (Source, Fileinfo)
- Remove readLine function as not needed anymore
f393b1e
to
190db27
Compare
* Rename FileEvent to Event * Remove double information between FileEvent and State (Source, Fileinfo) * Remove readLine function as not needed anymore
@@ -63,8 +64,7 @@ func (h *Harvester) Harvest() { | |||
default: | |||
} | |||
|
|||
// Partial lines return error and are only read on completion | |||
ts, text, bytesRead, jsonFields, err := readLine(r) | |||
message, err := r.Next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@urso The behaviour here should be identical to before, but hopefully better readable. An event is still created if Byte == 0 but this is filtered out as a state update only by the publisher. I assume this happens when an event only consists of a newline. So the state will be updated no event will be sent to the output. Alternatively we could also check inside shouldExportLine for bytes == 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normally new lines characters are added to byte count, so to have correct offset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for using struct over 4 variables
190db27
to
ac4a155
Compare
LGTM. waiting for travis. |
Empty lines should not be sent as an event. To make sure this does not happen a test was added. This was probably broken in elastic#2090
Empty lines should not be sent as an event. To make sure this does not happen a test was added. This was probably broken in #2090