swaminathanmanish commented on code in PR #13528:
URL: https://github.com/apache/pinot/pull/13528#discussion_r1663467898


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -1682,25 +1682,38 @@ public long getTimeSinceEventLastConsumedMs() {
     return _idleTimer.getTimeSinceEventLastConsumedMs();
   }
 
+  public StreamPartitionMsgOffset fetchLatestStreamOffset(long maxWaitTimeMs, 
boolean useDebugLog) {
+    return fetchStreamOffset(OffsetCriteria.LARGEST_OFFSET_CRITERIA, 
maxWaitTimeMs, useDebugLog);
+  }
+
   public StreamPartitionMsgOffset fetchLatestStreamOffset(long maxWaitTimeMs) {
-    return fetchStreamOffset(OffsetCriteria.LARGEST_OFFSET_CRITERIA, 
maxWaitTimeMs);
+    return fetchLatestStreamOffset(maxWaitTimeMs, false);
+  }
+
+  public StreamPartitionMsgOffset fetchEarliestStreamOffset(long 
maxWaitTimeMs, boolean useDebugLog) {
+    return fetchStreamOffset(OffsetCriteria.SMALLEST_OFFSET_CRITERIA, 
maxWaitTimeMs, useDebugLog);
   }
 
   public StreamPartitionMsgOffset fetchEarliestStreamOffset(long 
maxWaitTimeMs) {
-    return fetchStreamOffset(OffsetCriteria.SMALLEST_OFFSET_CRITERIA, 
maxWaitTimeMs);
+    return fetchEarliestStreamOffset(maxWaitTimeMs, false);
   }
 
-  private StreamPartitionMsgOffset fetchStreamOffset(OffsetCriteria 
offsetCriteria, long maxWaitTimeMs) {
+  private StreamPartitionMsgOffset fetchStreamOffset(OffsetCriteria 
offsetCriteria, long maxWaitTimeMs,
+      boolean useDebugLog) {
     if (_partitionMetadataProvider == null) {
       createPartitionMetadataProvider("Fetch latest stream offset");
     }
     try {
       return 
_partitionMetadataProvider.fetchStreamPartitionOffset(offsetCriteria, 
maxWaitTimeMs);
     } catch (Exception e) {
-      _segmentLogger.warn(
-          String.format(
-              "Cannot fetch stream offset with criteria %s for clientId %s and 
partitionGroupId %d with maxWaitTime %d",
-              offsetCriteria, _clientId, _partitionGroupId, maxWaitTimeMs), e);
+      String logMessage = String.format(

Review Comment:
   Would it be good to interface out the metrics part in the consumer, so that 
a consumer can skip emitting metrics if not supported ? 



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