This is an automated email from the ASF dual-hosted git repository.
ethanfeng 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 9621d1150 [CELEBORN-1572][FOLLOWUP] master --send-worker-event should
support RECOMMISSION and NONE event type
9621d1150 is described below
commit 9621d1150de3fd115e76b5f8f7fd8809496e9cfc
Author: SteNicholas <[email protected]>
AuthorDate: Fri Sep 13 21:32:04 2024 +0800
[CELEBORN-1572][FOLLOWUP] master --send-worker-event should support
RECOMMISSION and NONE event type
### What changes were proposed in this pull request?
`master --send-worker-event` should support `RECOMMISSION` and `NONE` event
type.
### Why are the changes needed?
Legal event types of `/api/v1/workers/events` are `IMMEDIATELY`,
`DECOMMISSION`, `DECOMMISSION_THEN_IDLE`, `GRACEFUL`, `RECOMMISSION`, `NONE`.
Therefore, `master --send-worker-event` should also support `RECOMMISSION` and
`NONE` event type.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
`TestCelebornCliCommands#master --send-worker-event`
Closes #2734 from SteNicholas/CELEBORN-1572.
Authored-by: SteNicholas <[email protected]>
Signed-off-by: mingji <[email protected]>
---
cli/src/main/scala/org/apache/celeborn/cli/master/MasterOptions.scala | 3 ++-
.../scala/org/apache/celeborn/cli/master/MasterSubcommandImpl.scala | 2 +-
.../test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git
a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterOptions.scala
b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterOptions.scala
index b22f0bb3f..95fda2028 100644
--- a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterOptions.scala
+++ b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterOptions.scala
@@ -45,7 +45,8 @@ final class MasterOptions {
@Option(
names = Array("--send-worker-event"),
- paramLabel = "IMMEDIATELY | DECOMMISSION | DECOMMISSION_THEN_IDLE |
GRACEFUL",
+ paramLabel =
+ "IMMEDIATELY | DECOMMISSION | DECOMMISSION_THEN_IDLE | GRACEFUL |
RECOMMISSION | NONE",
description = Array("Send an event to a worker"))
private[master] var sendWorkerEvent: String = _
diff --git
a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommandImpl.scala
b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommandImpl.scala
index 50a643ca8..984d3bee9 100644
---
a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommandImpl.scala
+++
b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommandImpl.scala
@@ -85,7 +85,7 @@ class MasterSubcommandImpl extends Runnable with
MasterSubcommand {
case _: IllegalArgumentException => throw new ParameterException(
spec.commandLine(),
"Worker event type must be " +
- "IMMEDIATELY, DECOMMISSION, DECOMMISSION_THEN_IDLE, or GRACEFUL")
+ EventTypeEnum.values().toStream.map(_.name()).mkString(","))
}
}
val workerIds = getWorkerIds
diff --git
a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
index 6e90650ac..ea36e0ac8 100644
--- a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
+++ b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
@@ -208,7 +208,7 @@ class TestCelebornCliCommands extends CelebornFunSuite with
MiniClusterFeature {
test("master --send-worker-event") {
val args = prepareMasterArgs() ++ Array(
"--send-worker-event",
- "DECOMMISSION",
+ "RECOMMISSION",
"--worker-ids",
getWorkerId())
captureOutputAndValidateResponse(args, "success: true")