ian910297 commented on code in PR #4102: URL: https://github.com/apache/gravitino/pull/4102#discussion_r1678462914
########## core/src/main/java/com/datastrato/gravitino/listener/api/info/PartitionInfo.java: ########## @@ -0,0 +1,74 @@ +/* + * 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 com.datastrato.gravitino.listener.api.info; + +import com.datastrato.gravitino.annotation.DeveloperApi; +import com.datastrato.gravitino.rel.partitions.Partition; +import com.google.common.collect.ImmutableMap; +import java.util.Map; + +/** + * 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 final class PartitionInfo { + private final String name; + private final Map<String, String> properties; + + /** + * Constructs PartitionInfo from an existing Partition object. + * + * @param partition The Partition instance to extract information from. + */ + public PartitionInfo(Partition partition) { Review Comment: I have two questions 1. I'm unsure whether to **declare PartitionInfo as an interface or a class**, since other XXXInfo are declared as classes. If declared as a class, the constructor in the child class would need to call the parent's constructor, which seems a bit ugly. 2. I don't know how to include RangePartitionInfo and others in PartitionEvent usage. PartitionDispatcher does not have any related calls, while Partitions provides a series of static builder methods for variations of partitions. So this requires individual events and helper methods similar to Partitions? -- 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]
