Abyss-lord commented on code in PR #7037:
URL: https://github.com/apache/gravitino/pull/7037#discussion_r2062861853
##########
api/src/main/java/org/apache/gravitino/model/ModelVersionChange.java:
##########
@@ -327,4 +349,92 @@ public String toString() {
return "UpdateUri " + newUri;
}
}
+
+ /** A ModelVersionChange to update the alias of a model version. */
+ final class UpdateAlias implements ModelVersionChange {
+ private final List<String> aliasesToAdd;
+ private final List<String> aliasesToDelete;
+
+ /**
+ * Creates a new {@link UpdateAlias} instance with specified aliases to
add and delete. This
+ * constructor sorts both lists and converts them to immutable collections.
+ *
+ * @param aliasesToAdd List of aliases to add to the model version, can be
null
+ * @param aliasesToDelete List of aliases to remove from the model
version, can be null
+ */
+ public UpdateAlias(List<String> aliasesToAdd, List<String>
aliasesToDelete) {
+ List<String> tmpAliasesToAdd = aliasesToAdd == null ? new ArrayList<>()
: aliasesToAdd;
+ List<String> tmpAliasesToDelete =
+ aliasesToDelete == null ? new ArrayList<>() : aliasesToDelete;
+
+ Collections.sort(tmpAliasesToAdd);
+ Collections.sort(tmpAliasesToDelete);
Review Comment:
I’ve switched to using a Set instead of a List to store the data.
--
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]