-
Notifications
You must be signed in to change notification settings - Fork 43
Add multiline support to TCP #125
Add multiline support to TCP #125
Conversation
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Sorry for the quality, but I want to get feedback of general idea quickly to resume work on that Tomorrow |
@sumo-drosiek, Thanks for taking a crack at this. I agree with moving encoding and multiline to helper. I may have some minor comments later, but overall this looks great. However, I don't see the value of the Reader. Can we just enhance |
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.
This looks great. Thanks @sumo-drosiek!
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
I change multiline to return splitFunc directly and renamed MaxBufferSize to MaxLogSize |
ready to go 🎉 |
@sumo-drosiek This looks great, but somehow the EasyCLA check is hung. I can't merge until is passes, and I don't see a way to retrigger it from my end. Will you please push a trivial commit in order to retrigger it? |
@djaglowski I noticed that I use encoder only during splitting messages. I need to use it in decoding messages as well. Due to that encoder helper will be probably changed (extended with decode method) |
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
decodeBuffer := make([]byte, 1<<12) | ||
decoder := e.Encoding.NewDecoder() |
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.
I create it every call to avoid race conditions
I left file reader implementation in file operator because it's optimized for that usecase
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.
Seems reasonable. If it proves to be a performance bottleneck at some point, we can look at optimizing then.
@djaglowski Please see latest commit and I think we are good to go :) |
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.
LGTM
decodeBuffer := make([]byte, 1<<12) | ||
decoder := e.Encoding.NewDecoder() |
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.
Seems reasonable. If it proves to be a performance bottleneck at some point, we can look at optimizing then.
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
This is my proposal for multiline support in TCP
It's not finished yet, but please see if this is acceptable direction