9aman commented on code in PR #17089:
URL: https://github.com/apache/pinot/pull/17089#discussion_r2471665538


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -1082,21 +1081,12 @@ public long getLastConsumedTimestamp() {
   /**
    * Returns the {@link ConsumerPartitionState} for the partition group.
    */
-  public Map<String, ConsumerPartitionState> getConsumerPartitionState() {
+  public Map<String, ConsumerPartitionState> getConsumerPartitionState(
+      @Nullable StreamPartitionMsgOffset latestMsgOffset) {
     String partitionGroupId = String.valueOf(_partitionGroupId);
-    return Collections.singletonMap(partitionGroupId, new 
ConsumerPartitionState(partitionGroupId, getCurrentOffset(),
-        getLastConsumedTimestamp(), fetchLatestStreamOffset(5_000), 
_lastRowMetadata));
-  }
-
-  /**
-   * Returns the {@link PartitionLagState} for the partition group.
-   */
-  public Map<String, PartitionLagState> getPartitionToLagState(

Review Comment:
   I see that these functions were used by `DebugResource.java` and 
`TablesResource.java`
   
   IIUC, we have removed reliance of any other class on 
`RealtimeSegmentDataManager` to fetch upstream info. 
   
   At the same time, these API's etc can still run into exceptions as they are 
using the same consumer. 
   
   The changes ensure the ingestion is not bothered but doesn't make the access 
completely thread safe (which seems to be okay.)
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to