You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2024/05/23 23:05:22 UTC

Re: [PR] Update consuming freshness field in query resp to be backed by the server reported ingestion delay timestamp [pinot]

Jackie-Jiang commented on code in PR #13207:
URL: https://github.com/apache/pinot/pull/13207#discussion_r1612444543


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -314,6 +314,22 @@ public void markPartitionForVerification(int partitionGroupId) {
     _partitionsMarkedForVerification.put(partitionGroupId, _clock.millis());
   }
 
+  /*
+   * Method to get timestamp used for the ingestion delay for a given partition.
+   *
+   * @param partitionGroupId partition for which we are retrieving the delay
+   *
+   * @return ingestion delay timestamp in milliseconds for the given partition ID.
+   */
+  public long getPartitionIngestionTimeMs(int partitionGroupId) {
+    // Not protected as this will only be invoked when metric is installed which happens after server ready
+    IngestionTimestamps currentMeasure = _partitionToIngestionTimestampsMap.get(partitionGroupId);
+    if (currentMeasure == null) { // Guard just in case we read the metric without initializing it
+      return 0;

Review Comment:
   Suggest returning `Long.MIN_VALUE` by default to be aligned with the segment metadata



-- 
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-unsubscribe@pinot.apache.org

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