jerryshao commented on code in PR #6967:
URL: https://github.com/apache/gravitino/pull/6967#discussion_r2048181627
##########
server/src/main/java/org/apache/gravitino/server/web/rest/ModelOperations.java:
##########
@@ -405,6 +408,97 @@ public Response deleteModelVersionByAlias(
}
}
+ @PUT
+ @Path("{model}/versions/{version}")
+ @Produces("application/vnd.gravitino.v1+json")
+ @Timed(name = "alter-model-version." + MetricNames.HTTP_PROCESS_DURATION,
absolute = true)
+ @ResponseMetered(name = "alter-model-version", absolute = true)
+ public Response alterModelVersion(
+ @PathParam("metalake") String metalake,
+ @PathParam("catalog") String catalog,
+ @PathParam("schema") String schema,
+ @PathParam("model") String model,
+ @PathParam("version") int version,
+ ModelVersionUpdatesRequest request) {
+ LOG.info(
+ "Received alter model version request: {}.{}.{}.{}.{}",
+ metalake,
+ catalog,
+ schema,
+ model,
+ version);
+ request.validate();
+
+ try {
+ NameIdentifier modelId = NameIdentifierUtil.ofModel(metalake, catalog,
schema, model);
+
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ request.validate();
+ ModelVersionChange[] changes =
+ request.getUpdates().stream()
+ .map(ModelVersionUpdateRequest::modelVersionChange)
+ .toArray(ModelVersionChange[]::new);
+
+ ModelVersion modelVersion =
+ modelDispatcher.alterModelVersion(modelId, version, changes);
+ Response response =
+ Utils.ok(new
ModelVersionResponse(DTOConverters.toDTO(modelVersion)));
+ LOG.info("Model version got: {}.{}", modelId, version);
Review Comment:
Please update the log, not "got", it should be "altered" or "updated".
--
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]