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


##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/IngestionConfigUtils.java:
##########
@@ -339,6 +339,23 @@ public static String getTableTopicUniqueClientId(String 
className, StreamConfig
         className + "-" + streamConfig.getTableNameWithType() + "-" + 
streamConfig.getTopicName());
   }
 
+  /**
+   * Returns the table-key string for realtime stream server metrics: {@code 
table-topic-partition} and optional
+   * {@code consumerClientIdSuffix} when non-blank.
+   *
+   * @param tableNameWithType table name with type (e.g. {@code 
myTable_REALTIME})
+   * @param topicName stream topic name
+   * @param streamPartitionId stream partition id
+   * @param consumerClientIdSuffix optional suffix; ignored if null or blank
+   */
+  public static String getStreamIngestionMetricTableKey(String 
tableNameWithType, String topicName,
+      int streamPartitionId, String consumerClientIdSuffix) {

Review Comment:
   (minor)
   ```suggestion
         int streamPartitionId, @Nullable String consumerClientIdSuffix) {
   ```



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -369,27 +379,40 @@ void setClock(Clock clock) {
     _clock = clock;
   }
 
+  /** Table key for ingestion gauges for {@code pinotPartitionId}, aligned 
with stream consumer metrics. */
+  private String getIngestionGaugeTableKey(int pinotPartitionId) {
+    TableConfig tableConfig = 
_realTimeTableDataManager.getCachedTableConfigAndSchema().getLeft();
+    List<StreamConfig> streamConfigs = 
IngestionConfigUtils.getStreamConfigs(tableConfig);
+    StreamConfig streamConfig = 
IngestionConfigUtils.getStreamConfigFromPinotPartitionId(streamConfigs,
+        pinotPartitionId);
+    int streamPartitionId =

Review Comment:
   (MAJOR) Is this behavior change? What happens to single-topic stream?



##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/IngestionConfigUtils.java:
##########
@@ -339,6 +339,23 @@ public static String getTableTopicUniqueClientId(String 
className, StreamConfig
         className + "-" + streamConfig.getTableNameWithType() + "-" + 
streamConfig.getTopicName());
   }
 
+  /**
+   * Returns the table-key string for realtime stream server metrics: {@code 
table-topic-partition} and optional
+   * {@code consumerClientIdSuffix} when non-blank.
+   *
+   * @param tableNameWithType table name with type (e.g. {@code 
myTable_REALTIME})
+   * @param topicName stream topic name
+   * @param streamPartitionId stream partition id
+   * @param consumerClientIdSuffix optional suffix; ignored if null or blank
+   */
+  public static String getStreamIngestionMetricTableKey(String 
tableNameWithType, String topicName,
+      int streamPartitionId, String consumerClientIdSuffix) {
+    if (StringUtils.isNotBlank(consumerClientIdSuffix)) {
+      return tableNameWithType + "-" + topicName + "-" + streamPartitionId + 
"-" + consumerClientIdSuffix;

Review Comment:
   (MAJOR) Is this a behavior change? This is not the same way how 
`AbstractMetrics` connecting parts



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