This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.5 by this push:
new bf3dd9471 [CELEBORN-1317][FOLLOWUP] Fix media type annotations for
form urlencoded APIs
bf3dd9471 is described below
commit bf3dd947134e30854b2481531f9a02747a3bf05f
Author: Fei Wang <[email protected]>
AuthorDate: Thu Jul 11 23:51:50 2024 +0800
[CELEBORN-1317][FOLLOWUP] Fix media type annotations for form urlencoded
APIs
### What changes were proposed in this pull request?
This PR is a follow up for https://github.com/apache/celeborn/pull/2495,
fix the media types.
### Why are the changes needed?
The media types shown in the swagger UI are not correct.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Before:
<img width="1439" alt="image"
src="https://github.com/apache/celeborn/assets/6757692/f287c02b-791c-4677-93b7-ac9c5e4ee34f">
After:
<img width="1341" alt="image"
src="https://github.com/apache/celeborn/assets/6757692/13e5d310-7c97-4872-9496-f9b12113b7ab">
Closes #2616 from turboFei/form_app.
Authored-by: Fei Wang <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit bd3f8236d08bafdd6aee62a9c510f97486044f7b)
Signed-off-by: Cheng Pan <[email protected]>
---
docs/migration.md | 8 ++++++++
.../service/deploy/master/http/api/ApiMasterResource.scala | 4 ++--
.../service/deploy/worker/http/api/ApiWorkerResource.scala | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/docs/migration.md b/docs/migration.md
index 63d29126d..a7ce650f1 100644
--- a/docs/migration.md
+++ b/docs/migration.md
@@ -21,6 +21,14 @@ license: |
# Migration Guide
+## Upgrading from 0.5.0 to 0.5.1
+
+- Since 0.5.1, Celeborn master REST API `/exclude` request uses media type
`application/x-www-form-urlencoded` instead of `text/plain`.
+
+- Since 0.5.1, Celeborn master REST API `/sendWorkerEvent` request uses POST
method and the parameters `type` and `workers` use form parameters instead, and
uses media type `application/x-www-form-urlencoded` instead of `text/plain`.
+
+- Since 0.5.1, Celeborn worker REST API `/exit` request uses media type
`application/x-www-form-urlencoded` instead of `text/plain`.
+
## Upgrading from 0.4 to 0.5
- Since 0.5.0, Celeborn master metrics `LostWorkers` is renamed as
`LostWorkerCount`.
diff --git
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/ApiMasterResource.scala
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/ApiMasterResource.scala
index 876e38716..5e465bdcc 100644
---
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/ApiMasterResource.scala
+++
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/ApiMasterResource.scala
@@ -87,7 +87,7 @@ class ApiMasterResource extends ApiRequestContext {
@ApiResponse(
responseCode = "200",
content = Array(new Content(
- mediaType = MediaType.TEXT_PLAIN)),
+ mediaType = MediaType.APPLICATION_FORM_URLENCODED)),
description =
"Excluded workers of the master add or remove the worker manually given
worker id. The parameter add or remove specifies the excluded workers to add or
remove, which value is separated by commas.")
@POST
@@ -101,7 +101,7 @@ class ApiMasterResource extends ApiRequestContext {
@ApiResponse(
responseCode = "200",
content = Array(new Content(
- mediaType = MediaType.TEXT_PLAIN)),
+ mediaType = MediaType.APPLICATION_FORM_URLENCODED)),
description =
"For Master(Leader) can send worker event to manager workers. Legal
types are 'None', 'Immediately', 'Decommission', 'DecommissionThenIdle',
'Graceful', 'Recommission', and the parameter workers is separated by commas.")
@POST
diff --git
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/http/api/ApiWorkerResource.scala
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/http/api/ApiWorkerResource.scala
index 0d0b1febd..f5e52e32d 100644
---
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/http/api/ApiWorkerResource.scala
+++
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/http/api/ApiWorkerResource.scala
@@ -69,7 +69,7 @@ class ApiWorkerResource extends ApiRequestContext {
@ApiResponse(
responseCode = "200",
content = Array(new Content(
- mediaType = MediaType.TEXT_PLAIN)),
+ mediaType = MediaType.APPLICATION_FORM_URLENCODED)),
description =
"Trigger this worker to exit. Legal types are 'Decommission', 'Graceful'
and 'Immediately'.")
@POST