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
ceph-dencoder: add missing begin_iter & end_iter item for RGWObjManifest #19509
Conversation
Signed-off-by: Songbo Wang wangsongbo@cloudin.cn
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
@@ -107,6 +127,9 @@ void RGWObjManifest::dump(Formatter *f) const | |||
::encode_json("rules", rules, f); | |||
::encode_json("tail_instance", tail_instance, f); | |||
::encode_json("tail_placement", tail_placement, f); | |||
|
|||
f->dump_object("begin_iter", begin_iter); |
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.
should be able to use encode_json() instead, probably better using it instead of all the direct formatter->dump() calls
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.
@yaozongyou in my previous pr(#18959 ), @tchaikov suggest to use formatter's method. It confused me which should be used.
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.
@yaozongyou well, it depends on if we are dumping a JSON or not. but in this case, i think RGWObjManifest::dump()
is a method accepting a general Formatter
, why shall we use encode_json()
?
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.
@tchaikov encode_json's last parameter is a general ceph::Formatter,it has the same capability with formatter->dump. and in this source code file, as the original GWObjManifest::dump using encode_json, we'd better keeping consistent with it.
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 has the same capability with formatter->dump.
also please note that the same applies to to encode_json()
. and the latter is a wrapper of the formatter->dump()
, extra cpu cycles wasted if not inlined.
as the original GWObjManifest::dump using encode_json, we'd better keeping consistent with it.
Foo::dump()
is a general interface used by Formatter
not just JSON dump methods, it's consistent to follow this convention. but i understand, the to use encode_json()
is also consistent with the rest part of this method or this source file. so no strong feelings either way. the reason i am chiming in here is merely that i am @'ed.
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.
as @tchaikov has no favor for either way and @mattbenjamin has approved it, @cooboos let's keep it as it is.
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.
@yaozongyou ok, thank you !
retest this please |
retest this please. |
test this please |
Signed-off-by: Songbo Wang wangsongbo@cloudin.cn