jugomezv commented on code in PR #9994:
URL: https://github.com/apache/pinot/pull/9994#discussion_r1061968584


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java:
##########
@@ -212,6 +216,83 @@ protected void doShutdown() {
     if (_leaseExtender != null) {
       _leaseExtender.shutDown();
     }
+    // Make sure we do metric cleanup when we shut down the table.
+    _ingestionDelayTracker.shutdown();
+  }
+
+  /*
+   * Method to handle CONSUMING->DROPPED transition.
+   *
+   * @param partitionGroupId Partition id that we must stop tracking on this 
server.
+   */
+  private void stopTrackingPartitionDelay(int partitionGroupId) {
+    
_ingestionDelayTracker.stopTrackingPartitionIngestionDelay(partitionGroupId);
+  }
+
+  /*
+   * Method to handle CONSUMING->ONLINE transition.
+   * If no new ingestion is noticed for this segment in some timeout, we will 
read
+   * ideal state to verify the partition is still hosted in this server.
+   *
+   * @param partitionGroupId partition id of partition to be verified as 
hosted by this server.
+   */
+  private void markPartitionForVerification(int partitionGroupId) {
+    _ingestionDelayTracker.markPartitionForConfirmation(partitionGroupId);
+  }
+
+  /*
+   * Method used by LLRealtimeSegmentManagers to update their partition delays
+   *
+   * @param ingestionDelayMs Ingestion delay being reported.
+   * @param currentTimeMs Timestamp of the measure being provided, i.e. when 
this delay was computed.
+   * @param partitionGroupId Partition ID for which delay is being updated.
+   */
+  public void updateIngestionDelay(long ingestionDelayMs, long currenTimeMs, 
int partitionGroupId) {
+    _ingestionDelayTracker.updateIngestionDelay(ingestionDelayMs, 
currenTimeMs, partitionGroupId);
+  }
+
+  /*
+   * Method to handle supported transitions of segments states for this table.
+   * Supported transitions include:
+   *
+   * CONSUMING -> ONLINE:
+   * We mark partitions for verification against ideal state when we do not 
see a consuming segment for some time
+   * for that partition. The idea is to remove the related metrics when the 
partition moves from the current server.
+   * CONSUMING -> DROPPED:
+   * We stop tracking partitions whose segments are dropped.
+   *
+   * @param segmentNameStr name of segment which is transitioning state.
+   * @param fromState state from which the segment is transitioning.
+   * @param toState state to which the segment is transitioning to.
+   */
+  @Override
+  public void onSegmentStateTransition(String segmentNameStr, SegmentState 
fromState, SegmentState toState) {

Review Comment:
   reverted this change to use two methods



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