jackjlli commented on a change in pull request #7375:
URL: https://github.com/apache/pinot/pull/7375#discussion_r698691561



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -66,8 +66,11 @@ public String getSegmentName() {
   public long getStartTimeMs() {
     if (!_startTimeMsCached) {
       String startTimeString = _simpleFields.get(Segment.START_TIME);
-      if (startTimeString != null && Long.parseLong(startTimeString) > 0) {
-        _startTimeMs = 
TimeUnit.valueOf(_simpleFields.get(Segment.TIME_UNIT)).toMillis(Long.parseLong(startTimeString));
+      // 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) {

Review comment:
       It seems the build isn't happy about inner assignment. Maybe adding a 
private method to extract the field helps?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to