You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by hu...@apache.org on 2026/08/15 05:39:31 UTC

(iceberg) branch main updated: API: Add Javadoc for the Metrics constructor parameters (#17608)

This is an automated email from the ASF dual-hosted git repository.

huaxingao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 50100e4624 API: Add Javadoc for the Metrics constructor parameters (#17608)
50100e4624 is described below

commit 50100e46242864113579639f61eecf85545b185f
Author: Uros Bojanic <22...@users.noreply.github.com>
AuthorDate: Sat Aug 15 07:39:25 2026 +0200

    API: Add Javadoc for the Metrics constructor parameters (#17608)
    
    * API: Add Javadoc for the Metrics constructor parameters
    
    Document each parameter of the canonical Metrics constructor, including that the maps and counts may be null when unknown.
    
    * Update api/src/main/java/org/apache/iceberg/Metrics.java
    
    Co-authored-by: Anoop Johnson <gi...@anoopjohnson.com>
    
    * Fix format
    
    * Followup changes
    
    ---------
    
    Co-authored-by: Anoop Johnson <gi...@anoopjohnson.com>
---
 api/src/main/java/org/apache/iceberg/Metrics.java | 42 +++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/api/src/main/java/org/apache/iceberg/Metrics.java b/api/src/main/java/org/apache/iceberg/Metrics.java
index eb13caf5e8..5b9d727a8a 100644
--- a/api/src/main/java/org/apache/iceberg/Metrics.java
+++ b/api/src/main/java/org/apache/iceberg/Metrics.java
@@ -41,12 +41,28 @@ public class Metrics implements Serializable {
   // this is not serialized with all the other fields
   private Map<Integer, Type> originalTypes = null;
 
+  /** Creates an empty metrics instance with no statistics set. */
   public Metrics() {}
 
+  /**
+   * Creates a new metrics instance with only the row count set.
+   *
+   * @param rowCount the number of rows (records) in the file
+   */
   public Metrics(long rowCount) {
     this.rowCount = rowCount;
   }
 
+  /**
+   * Creates a new metrics instance.
+   *
+   * @param rowCount the number of rows (records) in the file, or null if unknown
+   * @param columnSizes a map of field id to the size in bytes of the column, or null if unknown
+   * @param valueCounts a map of field id to the number of all values (including nulls, NaN, and
+   *     repeated), or null if unknown
+   * @param nullValueCounts a map of field id to the number of null values, or null if unknown
+   * @param nanValueCounts a map of field id to the number of NaN values, or null if unknown
+   */
   public Metrics(
       Long rowCount,
       Map<Integer, Long> columnSizes,
@@ -56,6 +72,18 @@ public class Metrics implements Serializable {
     this(rowCount, columnSizes, valueCounts, nullValueCounts, nanValueCounts, null, null, null);
   }
 
+  /**
+   * Creates a new metrics instance.
+   *
+   * @param rowCount the number of rows (records) in the file, or null if unknown
+   * @param columnSizes a map of field id to the size in bytes of the column, or null if unknown
+   * @param valueCounts a map of field id to the number of all values (including nulls, NaN, and
+   *     repeated), or null if unknown
+   * @param nullValueCounts a map of field id to the number of null values, or null if unknown
+   * @param nanValueCounts a map of field id to the number of NaN values, or null if unknown
+   * @param lowerBounds a map of field id to the lower bound of the column, or null if unknown
+   * @param upperBounds a map of field id to the upper bound of the column, or null if unknown
+   */
   public Metrics(
       Long rowCount,
       Map<Integer, Long> columnSizes,
@@ -75,6 +103,20 @@ public class Metrics implements Serializable {
         null);
   }
 
+  /**
+   * Creates a new metrics instance.
+   *
+   * @param rowCount the number of rows (records) in the file, or null if unknown
+   * @param columnSizes a map of field id to the size in bytes of the column, or null if unknown
+   * @param valueCounts a map of field id to the number of all values (including nulls, NaN, and
+   *     repeated), or null if unknown
+   * @param nullValueCounts a map of field id to the number of null values, or null if unknown
+   * @param nanValueCounts a map of field id to the number of NaN values, or null if unknown
+   * @param lowerBounds a map of field id to the lower bound of the column, or null if unknown
+   * @param upperBounds a map of field id to the upper bound of the column, or null if unknown
+   * @param originalTypes a map of field id to the original type of the lower/upper bound, or null
+   *     if unknown
+   */
   public Metrics(
       Long rowCount,
       Map<Integer, Long> columnSizes,