hawk9821 commented on code in PR #7088:
URL: https://github.com/apache/seatunnel/pull/7088#discussion_r1672616635


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SeaTunnelSourceCollector.java:
##########
@@ -100,21 +119,33 @@ public SeaTunnelSourceCollector(
     public void collect(T row) {
         try {
             if (row instanceof SeaTunnelRow) {
+                String tableId = ((SeaTunnelRow) row).getTableId();
                 int size;
                 if (rowType instanceof SeaTunnelRowType) {
                     size = ((SeaTunnelRow) 
row).getBytesSize((SeaTunnelRowType) rowType);
                 } else if (rowType instanceof MultipleRowType) {
-                    size =
-                            ((SeaTunnelRow) row)
-                                    .getBytesSize(
-                                            rowTypeMap.get(((SeaTunnelRow) 
row).getTableId()));
+                    size = ((SeaTunnelRow) 
row).getBytesSize(rowTypeMap.get(tableId));
                 } else {
                     throw new SeaTunnelEngineException(
                             "Unsupported row type: " + 
rowType.getClass().getName());
                 }
                 sourceReceivedBytes.inc(size);
                 sourceReceivedBytesPerSeconds.markEvent(size);
                 flowControlGate.audit((SeaTunnelRow) row);
+                if (StringUtils.isNotEmpty(tableId)) {
+                    String tableName = TablePath.of(tableId).getTableName();
+                    if (StringUtils.isNotBlank(tableName)) {
+                        Counter sourceTableCounter = 
sourceReceivedCountPerTable.get(tableName);
+                        if (Objects.nonNull(sourceTableCounter)) {
+                            sourceTableCounter.inc();
+                        } else {
+                            sourceReceivedCountPerTable.put(
+                                    tableName,
+                                    metricsContext.counter(
+                                            SOURCE_RECEIVED_COUNT + "#" + 
tableName));

Review Comment:
   Fixed 



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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to