You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/11/04 23:25:10 UTC

[GitHub] [incubator-pinot] Jackie-Jiang opened a new pull request #6239: Always read start/end time in millis from the segment ZK metadata

Jackie-Jiang opened a new pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239


   ## Description
   For issue #6222 
   
   This PR adds the APIs to read the start/end time in millis from the `SegmentZKMetadata`, deprecates the old getters.
   Also modifies the logic in `TimeBoundaryManager` to support SDF for the hybrid table.


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r520824060



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set
-    if (_startTime >= 0 && _startTime <= _endTime) {
-      _timeInterval = new Interval(_timeUnit.toMillis(_startTime), _timeUnit.toMillis(_endTime));
-    }
-  }
-
-  public Duration getTimeGranularity() {
-    return _timeGranularity;
-  }
-
-  public Interval getTimeInterval() {

Review comment:
       Done

##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set
-    if (_startTime >= 0 && _startTime <= _endTime) {
-      _timeInterval = new Interval(_timeUnit.toMillis(_startTime), _timeUnit.toMillis(_endTime));
-    }
-  }
-
-  public Duration getTimeGranularity() {

Review comment:
       Done




----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] Jackie-Jiang merged pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang merged pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239


   


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] codecov-io edited a comment on pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#issuecomment-722050397


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=h1) Report
   > Merging [#6239](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) will **decrease** coverage by `20.24%`.
   > The diff coverage is `51.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6239/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6239       +/-   ##
   ===========================================
   - Coverage   66.44%   46.20%   -20.25%     
   ===========================================
     Files        1075     1240      +165     
     Lines       54773    58895     +4122     
     Branches     8168     8730      +562     
   ===========================================
   - Hits        36396    27210     -9186     
   - Misses      15700    29453    +13753     
   + Partials     2677     2232      -445     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `46.20% <51.43%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ava/org/apache/pinot/client/AbstractResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Fic3RyYWN0UmVzdWx0U2V0LmphdmE=) | `26.66% <0.00%> (-30.48%)` | :arrow_down: |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [.../org/apache/pinot/client/ResultTableResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L1Jlc3VsdFRhYmxlUmVzdWx0U2V0LmphdmE=) | `24.00% <0.00%> (-10.29%)` | :arrow_down: |
   | ... and [1229 more](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=footer). Last update [bee125e...a38db32](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] codecov-io commented on pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#issuecomment-722050397


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=h1) Report
   > Merging [#6239](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) will **decrease** coverage by `2.36%`.
   > The diff coverage is `45.18%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6239/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #6239      +/-   ##
   ==========================================
   - Coverage   66.44%   64.08%   -2.37%     
   ==========================================
     Files        1075     1240     +165     
     Lines       54773    58895    +4122     
     Branches     8168     8730     +562     
   ==========================================
   + Hits        36396    37741    +1345     
   - Misses      15700    18399    +2699     
   - Partials     2677     2755      +78     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | unittests | `64.08% <45.18%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...e/pinot/broker/api/resources/PinotBrokerDebug.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL3Jlc291cmNlcy9QaW5vdEJyb2tlckRlYnVnLmphdmE=) | `0.00% <0.00%> (-79.32%)` | :arrow_down: |
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `71.42% <ø> (-28.58%)` | :arrow_down: |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `33.96% <0.00%> (-32.71%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ava/org/apache/pinot/client/AbstractResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Fic3RyYWN0UmVzdWx0U2V0LmphdmE=) | `66.66% <0.00%> (+9.52%)` | :arrow_up: |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `35.55% <0.00%> (-13.29%)` | :arrow_down: |
   | [...inot/client/JsonAsyncHttpPinotClientTransport.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydC5qYXZh) | `10.90% <0.00%> (-51.10%)` | :arrow_down: |
   | [...not/common/assignment/InstancePartitionsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vYXNzaWdubWVudC9JbnN0YW5jZVBhcnRpdGlvbnNVdGlscy5qYXZh) | `73.80% <ø> (+0.63%)` | :arrow_up: |
   | [.../apache/pinot/common/exception/QueryException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vZXhjZXB0aW9uL1F1ZXJ5RXhjZXB0aW9uLmphdmE=) | `90.27% <ø> (+5.55%)` | :arrow_up: |
   | [...pinot/common/function/AggregationFunctionType.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vZnVuY3Rpb24vQWdncmVnYXRpb25GdW5jdGlvblR5cGUuamF2YQ==) | `98.27% <ø> (-1.73%)` | :arrow_down: |
   | ... and [1080 more](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=footer). Last update [bee125e...a38db32](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] codecov-io edited a comment on pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#issuecomment-722050397


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=h1) Report
   > Merging [#6239](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=desc) (580c85b) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) (1beaab5) will **decrease** coverage by `20.16%`.
   > The diff coverage is `51.69%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6239/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6239       +/-   ##
   ===========================================
   - Coverage   66.44%   46.28%   -20.17%     
   ===========================================
     Files        1075     1243      +168     
     Lines       54773    58949     +4176     
     Branches     8168     8739      +571     
   ===========================================
   - Hits        36396    27283     -9113     
   - Misses      15700    29427    +13727     
   + Partials     2677     2239      -438     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `46.28% <51.69%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ava/org/apache/pinot/client/AbstractResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Fic3RyYWN0UmVzdWx0U2V0LmphdmE=) | `26.66% <0.00%> (-30.48%)` | :arrow_down: |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [.../org/apache/pinot/client/ResultTableResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L1Jlc3VsdFRhYmxlUmVzdWx0U2V0LmphdmE=) | `24.00% <0.00%> (-10.29%)` | :arrow_down: |
   | ... and [1233 more](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=footer). Last update [c8d7efc...580c85b](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r520825806



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/generator/RealtimeToOfflineSegmentsTaskGenerator.java
##########
@@ -287,21 +284,14 @@ private long getWatermarkMs(String realtimeTableName, List<LLCRealtimeSegmentZKM
       long watermarkMs;
 
       // Find the smallest time from all segments
-      RealtimeSegmentZKMetadata minSegmentZkMetadata = null;
+      long minStartTimeMs = Long.MAX_VALUE;
       for (LLCRealtimeSegmentZKMetadata realtimeSegmentZKMetadata : completedSegmentsMetadata) {
-        if (minSegmentZkMetadata == null || realtimeSegmentZKMetadata.getStartTime() < minSegmentZkMetadata
-            .getStartTime()) {
-          minSegmentZkMetadata = realtimeSegmentZKMetadata;
-        }
+        minStartTimeMs = Math.min(minStartTimeMs, realtimeSegmentZKMetadata.getStartTimeMs());
       }

Review comment:
       It's not really possible with the current code, but added it in case the code changes in the future




----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r518275105



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set

Review comment:
       True, time unit won't be set as well.
   The new code doesn't have the requirement of setting start/end before time unit.




----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] codecov-io edited a comment on pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#issuecomment-722050397


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=h1) Report
   > Merging [#6239](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=desc) (580c85b) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) (1beaab5) will **decrease** coverage by `19.93%`.
   > The diff coverage is `51.82%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6239/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6239       +/-   ##
   ===========================================
   - Coverage   66.44%   46.51%   -19.94%     
   ===========================================
     Files        1075     1243      +168     
     Lines       54773    58949     +4176     
     Branches     8168     8739      +571     
   ===========================================
   - Hits        36396    27418     -8978     
   - Misses      15700    29299    +13599     
   + Partials     2677     2232      -445     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `46.51% <51.82%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ava/org/apache/pinot/client/AbstractResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Fic3RyYWN0UmVzdWx0U2V0LmphdmE=) | `26.66% <0.00%> (-30.48%)` | :arrow_down: |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [.../org/apache/pinot/client/ResultTableResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L1Jlc3VsdFRhYmxlUmVzdWx0U2V0LmphdmE=) | `24.00% <0.00%> (-10.29%)` | :arrow_down: |
   | ... and [1232 more](https://codecov.io/gh/apache/incubator-pinot/pull/6239/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=footer). Last update [c8d7efc...580c85b](https://codecov.io/gh/apache/incubator-pinot/pull/6239?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r517744966



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set

Review comment:
       For consuming segment, neither start nor end time will be set.




----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-pinot] snleee commented on a change in pull request #6239: Always read start/end time in millis from the segment ZK metadata

Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #6239:
URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r518946846



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set
-    if (_startTime >= 0 && _startTime <= _endTime) {
-      _timeInterval = new Interval(_timeUnit.toMillis(_startTime), _timeUnit.toMillis(_endTime));
-    }
-  }
-
-  public Duration getTimeGranularity() {
-    return _timeGranularity;
-  }
-
-  public Interval getTimeInterval() {

Review comment:
       Can we put `@Deprecated` annotation instead of removing the function?

##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/generator/RealtimeToOfflineSegmentsTaskGenerator.java
##########
@@ -287,21 +284,14 @@ private long getWatermarkMs(String realtimeTableName, List<LLCRealtimeSegmentZKM
       long watermarkMs;
 
       // Find the smallest time from all segments
-      RealtimeSegmentZKMetadata minSegmentZkMetadata = null;
+      long minStartTimeMs = Long.MAX_VALUE;
       for (LLCRealtimeSegmentZKMetadata realtimeSegmentZKMetadata : completedSegmentsMetadata) {
-        if (minSegmentZkMetadata == null || realtimeSegmentZKMetadata.getStartTime() < minSegmentZkMetadata
-            .getStartTime()) {
-          minSegmentZkMetadata = realtimeSegmentZKMetadata;
-        }
+        minStartTimeMs = Math.min(minStartTimeMs, realtimeSegmentZKMetadata.getStartTimeMs());
       }

Review comment:
       Do we want to add
   
   ```
   Preconditions.checkState(minStartTimeMs != Long.MAX_VALUE);
   ```
   
   to throw the exception at the same condition?

##########
File path: pinot-common/src/main/java/org/apache/pinot/common/metadata/segment/SegmentZKMetadata.java
##########
@@ -105,54 +97,40 @@ public void setSegmentName(String segmentName) {
     _segmentName = segmentName;
   }
 
-  @Deprecated
-  public String getTableName() {
-    return _tableName;
+  public SegmentType getSegmentType() {
+    return _segmentType;
   }
 
-  @Deprecated
-  public void setTableName(String tableName) {
-    _tableName = tableName;
+  public void setSegmentType(SegmentType segmentType) {
+    _segmentType = segmentType;
   }
 
-  public long getStartTime() {
-    return _startTime;
+  public long getStartTimeMs() {
+    if (_startTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_startTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setStartTime(long startTime) {
     _startTime = startTime;
   }
 
-  public long getEndTime() {
-    return _endTime;
+  public long getEndTimeMs() {
+    if (_endTime > 0 && _timeUnit != null) {
+      return _timeUnit.toMillis(_endTime);
+    } else {
+      return -1;
+    }
   }
 
   public void setEndTime(long endTime) {
     _endTime = endTime;
   }
 
-  public TimeUnit getTimeUnit() {
-    return _timeUnit;
-  }
-
-  /**
-   * NOTE: should be called after setting start and end time.
-   */
-  public void setTimeUnit(@Nonnull TimeUnit timeUnit) {
+  public void setTimeUnit(TimeUnit timeUnit) {
     _timeUnit = timeUnit;
-    _timeGranularity = new Duration(_timeUnit.toMillis(1));
-    // For consuming segment, end time might not be set
-    if (_startTime >= 0 && _startTime <= _endTime) {
-      _timeInterval = new Interval(_timeUnit.toMillis(_startTime), _timeUnit.toMillis(_endTime));
-    }
-  }
-
-  public Duration getTimeGranularity() {

Review comment:
       Can we put `@Deprecated ` annotation instead of removing this?




----------------------------------------------------------------
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.

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



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