jerryshao commented on code in PR #7829:
URL: https://github.com/apache/gravitino/pull/7829#discussion_r2281431168
##########
common/src/main/java/org/apache/gravitino/dto/util/DTOConverters.java:
##########
@@ -841,6 +843,29 @@ public static GroupDTO[] toDTOs(Group[] groups) {
return
Arrays.stream(groups).map(DTOConverters::toDTO).toArray(GroupDTO[]::new);
}
+ /**
+ * Converts an array of statistics to an array of StatisticDTOs.
+ *
+ * @param statistics The statistics to be converted.
+ * @return The array of StatisticDTOs.
+ */
+ public static StatisticDTO[] toDTOs(Statistic[] statistics) {
+ if (ArrayUtils.isEmpty(statistics)) {
+ return new StatisticDTO[0];
+ }
+
+ return Arrays.stream(statistics)
+ .map(
+ statistic ->
+ StatisticDTO.builder()
+ .withName(statistic.name())
+ .withValue(statistic.value())
+ .withModifiable(statistic.modifiable())
+ .withReserved(statistic.reserved())
+ .build())
Review Comment:
Why there's no audit field.
--
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]