jerryshao commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2300704352
##########
clients/client-java/src/main/java/org/apache/gravitino/client/GenericModelCatalog.java:
##########
@@ -240,6 +242,54 @@ public void linkModelVersion(
resp.validate();
}
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, int version, String
uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(version >= 0, "Model version must be
non-negative");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
+ ModelVersionUriResponse resp =
+ restClient.get(
+ formatModelVersionRequestPath(modelFullIdent) + "/versions/" +
version + "/uri",
+ queryParam,
+ ModelVersionUriResponse.class,
+ Collections.emptyMap(),
+ ErrorHandlers.modelErrorHandler());
+ resp.validate();
+ return resp.getUri();
+ }
+
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, String alias, String
uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(StringUtils.isNotBlank(alias), "Model alias
must be non-empty");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
Review Comment:
Also here.
--
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]