gianm commented on code in PR #19177:
URL: https://github.com/apache/druid/pull/19177#discussion_r2961214452
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTaskUtils.java:
##########
@@ -102,4 +104,19 @@ public static void emitSegmentPublishMetrics(
toolbox.getEmitter().emit(metricBuilder.setMetric("segment/txn/failure",
1));
}
}
+
+ /**
+ * Gets total row count of the given segments. Legacy segments do not have
the
+ * row count populated in the metadata and thus do not contribute to the row
+ * count.
+ */
+ public static int getTotalRowCount(Collection<DataSegment> segments)
+ {
+ return segments
+ .stream()
+ .map(DataSegment::getTotalRows)
+ .filter(Objects::nonNull)
+ .mapToInt(Integer::intValue)
+ .sum();
Review Comment:
A single batch ingest could publish more than 2 billion rows, please make
this a `long` sum.
--
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]