This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new bd3f8236d [CELEBORN-1317][FOLLOWUP] Fix media type annotations for
form urlencoded APIs
bd3f8236d is described below
commit bd3f8236d08bafdd6aee62a9c510f97486044f7b
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]>
---
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 0e32de2f3..ee6fcdd67 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
@@ -100,7 +100,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
@@ -122,7 +122,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 d6c64f68f..a116fb950 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
@@ -80,7 +80,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