-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support compress in forward plugin #1179
Support compress in forward plugin #1179
Conversation
44edf57
to
38fc6ac
Compare
@compressed_data = data | ||
end | ||
|
||
def dup |
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 re-implementation looks no need.
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.
Ah... It's better to fix original implementation MessagePackEventStream#dup
to use self.class
instead of re-implementing this method in subclass.
I added review comments on code. |
@tagomoris |
9e387f2
to
04d1366
Compare
I rebased and updated code. |
956676f
to
18e530f
Compare
end | ||
|
||
def each(&block) | ||
ensure_decompressed! unless @unpacked_times |
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.
Unnecessary unless
18e530f
to
3808249
Compare
@ganmacs could you rebase/update your change? |
@tagomoris |
entries = '' | ||
events.each do |_tag, _time, record| | ||
v = '' | ||
[_time, record].to_msgpack(v) |
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.
It's already deprecated feature to assign String objects as an argument of #to_msgpack
.
Please update the code as v << [_time, record].to_msgpack
.
and use event_time
b766cb7
to
e1bc305
Compare
@tagomoris |
@times.zip(@records).each do |_time, record| | ||
v = '' | ||
v << [_time, record].to_msgpack | ||
@packed_record += v |
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.
@packed_record << [_time, record].to_msgpack
looks to work well, and it's simple.
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.
oops😨
Thanks. Fixed it.
and add test to ensure call log.info
e1bc305
to
6535ef9
Compare
I removed my LGTM, because I found the bug and missing tests, from warning of test results.
This warning shows that Node instances doesn't have instance variable named as |
@tagomoris |
f1ed8a8
to
80addd2
Compare
@ganmacs It's ok, but not enough. It's needed to check whether |
@tagomoris I added a test that |
4642699
to
60381fa
Compare
LGTM. Thank you for great patch! |
* Add CompressedMessagePackEventStream class it contain compressd message pack * Use CompressedMessagePackEventStream to handle compressed data * Add compress config_params to out_forward * Change compressed to ensure_compress! * Not to enable compress forcedly * `compress` -> `compressed` * Fix failed test and use event_time * Remove deprecated methods * Change test description and add test to ensure call log.info * Add tests to check `ensure_decompressed` is called * Fix a bug that `Node` doesn't have compress type * Add a test that `in_forward` creates CompressedMessagePackEventStream
Because this PR depends on #1172, please merge this after merging #1172.
This PR closes #504.