jerryshao commented on code in PR #6861:
URL: https://github.com/apache/gravitino/pull/6861#discussion_r2043705875


##########
core/src/main/java/org/apache/gravitino/listener/api/event/AlterModelVersionFailureEvent.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.event;
+
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.annotation.DeveloperApi;
+import org.apache.gravitino.listener.api.info.Either;
+import org.apache.gravitino.model.ModelVersionChange;
+
+/** Represents an event triggered when a model version alteration operation 
fails. */
+@DeveloperApi
+public class AlterModelVersionFailureEvent extends ModelFailureEvent {
+  private final Either<String, Integer> aliasOrVersion;
+  private ModelVersionChange[] modelVersionChanges;
+
+  /**
+   * Constructs a new {@code AlterModelVersionFailureEvent} instance. Only one 
of {@code alias} or
+   * {@code version} should be specified.
+   *
+   * @param user the user who triggered the event
+   * @param identifier the identifier of the model involved in the event
+   * @param exception the exception that caused the failure
+   * @param aliasOrVersion the alias or version of the model version involved 
in the event
+   * @param modelVersionChanges an array of {@code ModelVersionChange} 
instances that were attempted
+   *     to be applied
+   */
+  public AlterModelVersionFailureEvent(
+      String user,
+      NameIdentifier identifier,
+      Exception exception,
+      Either<String, Integer> aliasOrVersion,
+      ModelVersionChange[] modelVersionChanges) {
+    super(user, identifier, exception);
+
+    this.aliasOrVersion = aliasOrVersion;
+    this.modelVersionChanges = modelVersionChanges;
+  }
+
+  /**
+   * Returns the alias of the model version involved in the event.
+   *
+   * @return an {@code Optional} containing the alias, or an empty {@code 
Optional} if not specified
+   */

Review Comment:
   I think you should update the javadoc here and below, this is already 
updated and cannot reflect the new code.



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to