Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We cannot import
java.time.Durationbecause we already importjavax.xml.datatype.Duration.I was wondering if we could get rid of
javax.xml.datatype.Durationthough and replace it withjava.time.Durationthat was not available in Java7 when we addedjavax.xml.datatype.Duration.Thoughts? \cc @jeqo who extended the reset tool via #3831
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.
The only place we need this duration is
java.time.Durationhasnegatedbut itsaddTois taking aTemporal, and all its extends likeLocalTimeetc do not have the right API ofgetTime. So I think we just keep it like this.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.
We should remove the javax.xml.datatype.Duration usage since it's not part of the Java base module.
Uh oh!
There was an error while loading. Please reload this page.
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 was locking into the corresponding KIPs
Both say:
Looking into JavaDocs of
java.time.Duration#parse()it says:Thus, it seems save to replace
with
Btw: we should do the same for
kafka.admin.ConsumerGroupCommand(I can add this change to this PR).Thoughts?
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.
@mjsax LGTM
Both
kafka/tools/StreamsResetter.javaandkafka/admin/ConsumerGroupCommand.scalashould be migrated to remove usage ofjavax.xml.datatype.*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.
@mjsax , I agree, it seems safe and desirable to swap them out.