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
Fix SegmentZKMetadata time handling #7375
Fix SegmentZKMetadata time handling #7375
Conversation
Check-style won't let you do the inline assignment. I got red flag as well so had to cast twice. |
Thanks for fixing getTimeInterval() |
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. Please double-check on the unit tests that are failing.
TimeUnit timeUnit = TimeUnit.valueOf(_simpleFields.get(Segment.TIME_UNIT)); | ||
return new Interval(timeUnit.toMillis(Long.parseLong(startTimeString)), | ||
timeUnit.toMillis(Long.parseLong(endTimeString))); | ||
long startTimeMs = getStartTimeMs(); |
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 like it is deprecated, and my IDE did not find any callers. If so, may be just remove?
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.
Will remove all the deprecated ones in a separate PR so that they are easier to track
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.
Minor but LGTM.
// NOTE: Need to check whether the start time is positive because some old segment ZK metadata contains negative | ||
// start time and null time unit | ||
long startTime; | ||
if (startTimeString != null && (startTime = Long.parseLong(startTimeString)) > 0) { |
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 seems the build isn't happy about inner assignment. Maybe adding a private method to extract the field helps?
7311f69
to
23af1f7
Compare
Codecov Report
@@ Coverage Diff @@
## master #7375 +/- ##
=============================================
- Coverage 71.72% 30.46% -41.26%
+ Complexity 3309 88 -3221
=============================================
Files 1515 1506 -9
Lines 75008 74664 -344
Branches 10910 10874 -36
=============================================
- Hits 53798 22749 -31049
- Misses 17581 49909 +32328
+ Partials 3629 2006 -1623
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
On top of #7372, fix the
getTimeInterval()
and minor performance improvement. Also add some comments for future reference