mchades commented on code in PR #4102:
URL: https://github.com/apache/gravitino/pull/4102#discussion_r1685887186


##########
core/src/main/java/org/apache/gravitino/listener/api/info/partitions/PartitionInfo.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.listener.api.info.partitions;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+import org.apache.gravitino.annotation.DeveloperApi;
+import org.apache.gravitino.exceptions.GravitinoRuntimeException;
+import org.apache.gravitino.rel.partitions.IdentityPartition;
+import org.apache.gravitino.rel.partitions.ListPartition;
+import org.apache.gravitino.rel.partitions.Partition;
+import org.apache.gravitino.rel.partitions.RangePartition;
+
+/**
+ * Provides access to metadata about a Partition instance, designed for use by 
event listeners. This
+ * class encapsulates the essential attributes of a Partition, including its 
name and properties
+ * information.
+ */
+@DeveloperApi
+public class PartitionInfo {

Review Comment:
   For examples:
   
   `PartitionInfo.java`:
   ```java
   @ DeveloperApi
   public interface PartitionInfo {
   
     /** @return The name of the partition. */
     String name();
   
     /** @return The properties of the partition, such as statistics, location, 
etc. */
     Map<String, String> properties();
   }
   ````
   `IdentityPartitionInfo.java`:
   ```java
   @DeveloperApi
   public final class IdentityPartitionInfo implements PartitionInfo {
     private String name;
     private Map<String, String> properties;
     private final String[][] fieldNames;
     private final Literal<?>[] values;
   
     /**
      * Constructs IdentityPartitionInfo with specified details.
      *
      * @param name The name of the Partition.
      * @param fieldNames The field names of the identity partition.
      * @param values The values of the identity partition.
      * @param properties A map of properties associated with the Partition.
      */
     private IdentityPartitionInfo(
         String name, String[][] fieldNames, Literal<?>[] values, Map<String, 
String> properties) {
       super(name, properties);
       this.fieldNames = fieldNames;
       this.values = values;
     }
     
       @Override
       public String name() {
         return name;
       }
   
       @Override
       public Map<String, String> properties() {
         return properties;
       }
     public String[][] fieldNames() {
       return fieldNames;
     }
     public Literal<?>[] values() {
       return values;
     }
   }
   ```
   
   PartitionInfos.java
   ```java
   public static IdentityPartitionInfo identity(IdentityPartitionIn 
identityPartitionIn) {
     // construct and return an IdentityPartitionInfo
     }
   ```



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

Reply via email to