Skip to content
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 Ruby's Time class in msgpack serde #2775

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

repeatedly
Copy link
Member

Signed-off-by: Masahiro Nakagawa repeatedly@gmail.com

Which issue(s) this PR fixes:
No issue.

What this PR does / why we need it:
Recent msgpack-ruby can (de)serialize Time class.
Add enable_msgpack_time_support parameter to system config for this feature.
This is useful for multiple time fields.

See also: https://github.com/msgpack/msgpack-ruby#serializing-and-deserializing-time-instances

fluentd v2 will enable this feature by default.

Docs Changes:
Will add enable_msgpack_time_support to system config article after merged the patch.

Release Note:
Same as title.

Recent msgpack-ruby can (de)serialize Time class.
Add enable_msgpack_time_support parameter to system config for this feature.
This is useful for multiple time fields.

Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
@repeatedly repeatedly added the enhancement Feature request or improve operations label Jan 14, 2020
@repeatedly repeatedly self-assigned this Jan 14, 2020
Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost seems good, but I added a comment due to a nitpick.

@@ -70,9 +70,15 @@ def self.unpacker(*args)
factory.unpacker(*args)
end

def self.init
def self.init(enable_time_support: false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we register MessagePack::Timestamp::TYPE in self.factory as well? Or it needn't to be registered there? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot self.factory because it is used in only tests...

Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
@repeatedly
Copy link
Member Author

Applied reviews.

Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. 👍

@repeatedly repeatedly merged commit fa6b695 into master Jan 15, 2020
@repeatedly repeatedly deleted the enable-msgpack-time-support branch January 15, 2020 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants