xiaozcy commented on code in PR #7622:
URL: https://github.com/apache/gravitino/pull/7622#discussion_r2212467457
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -226,13 +228,26 @@ public ModelVersion getModelVersion(NameIdentifier ident,
String alias)
@Override
public void linkModelVersion(
NameIdentifier ident,
- String uri,
+ Map<String, String> uris,
String[] aliases,
String comment,
Map<String, String> properties)
throws NoSuchModelException, ModelVersionAliasesAlreadyExistException {
NameIdentifierUtil.checkModel(ident);
+ if (uris == null || uris.isEmpty()) {
+ throw new IllegalArgumentException("At least one URI needs to be set for
the model version");
+ }
+ uris.forEach(
+ (name, uri) -> {
+ if (StringUtils.isBlank(name)) {
+ throw new IllegalArgumentException("URI name must not be blank");
+ }
+ if (StringUtils.isBlank(uri)) {
+ throw new IllegalArgumentException("URI must not be blank for
name: " + name);
+ }
+ });
+
Review Comment:
OK, I'll remove these checks for now add them when REST API is supported
later(#7436).
--
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]