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 5dea9f13d [CELEBORN-1593][FOLLOWUP] Support master
--show-manual-excluded-workers command to show manual excluded workers
5dea9f13d is described below
commit 5dea9f13d2539bc0b4902119148ed943c7113093
Author: SteNicholas <[email protected]>
AuthorDate: Thu Oct 10 20:16:42 2024 +0800
[CELEBORN-1593][FOLLOWUP] Support master --show-manual-excluded-workers
command to show manual excluded workers
### What changes were proposed in this pull request?
Support `master --show-manual-excluded-workers` command to show manual
excluded workers.
### Why are the changes needed?
`/api/v1/workers` returns the manual excluded workers, which could also be
supported in master command.
### Does this PR introduce _any_ user-facing change?
Introduce `master --show-manual-excluded-workers` command.
### How was this patch tested?
`TestCelebornCliCommands#master --show-manual-excluded-workers`
Closes #2790 from SteNicholas/CELEBORN-1593.
Authored-by: SteNicholas <[email protected]>
Signed-off-by: mingji <[email protected]>
---
.../scala/org/apache/celeborn/cli/master/MasterOptions.scala | 5 +++++
.../org/apache/celeborn/cli/master/MasterSubcommand.scala | 2 ++
.../org/apache/celeborn/cli/master/MasterSubcommandImpl.scala | 11 +++++++++++
.../org/apache/celeborn/cli/TestCelebornCliCommands.scala | 5 +++++
4 files changed, 23 insertions(+)
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 a90d4e58c..3f4c3d115 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
@@ -61,6 +61,11 @@ final class MasterOptions {
@Option(names = Array("--show-excluded-workers"), description = Array("Show
excluded workers"))
private[master] var showExcludedWorkers: Boolean = _
+ @Option(
+ names = Array("--show-manual-excluded-workers"),
+ description = Array("Show manual excluded workers"))
+ private[master] var showManualExcludedWorkers: Boolean = _
+
@Option(names = Array("--show-shutdown-workers"), description = Array("Show
shutdown workers"))
private[master] var showShutdownWorkers: Boolean = _
diff --git
a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommand.scala
b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommand.scala
index cb67ca20e..a99cfa575 100644
--- a/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommand.scala
+++ b/cli/src/main/scala/org/apache/celeborn/cli/master/MasterSubcommand.scala
@@ -90,6 +90,8 @@ trait MasterSubcommand extends CliLogging {
private[master] def runShowExcludedWorkers: Seq[WorkerData]
+ private[master] def runShowManualExcludedWorkers: Seq[WorkerData]
+
private[master] def runShowShutdownWorkers: Seq[WorkerData]
private[master] def runShowDecommissioningWorkers: Seq[WorkerData]
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 0b8a53c07..b9b331e32 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
@@ -42,6 +42,7 @@ class MasterSubcommandImpl extends Runnable with
MasterSubcommand {
if (masterOptions.showWorkerEventInfo) log(runShowWorkerEventInfo)
if (masterOptions.showLostWorkers) log(runShowLostWorkers)
if (masterOptions.showExcludedWorkers) log(runShowExcludedWorkers)
+ if (masterOptions.showManualExcludedWorkers)
log(runShowManualExcludedWorkers)
if (masterOptions.showShutdownWorkers) log(runShowShutdownWorkers)
if (masterOptions.showDecommissioningWorkers)
log(runShowDecommissioningWorkers)
if (masterOptions.showLifecycleManagers) log(runShowLifecycleManagers)
@@ -129,6 +130,16 @@ class MasterSubcommandImpl extends Runnable with
MasterSubcommand {
}
}
+ private[master] def runShowManualExcludedWorkers: Seq[WorkerData] = {
+ val manualExcludedWorkers =
runShowWorkers.getManualExcludedWorkers.asScala.toSeq
+ if (manualExcludedWorkers.isEmpty) {
+ log("No manual excluded workers found.")
+ Seq.empty[WorkerData]
+ } else {
+ manualExcludedWorkers.sortBy(_.getHost)
+ }
+ }
+
private[master] def runShowShutdownWorkers: Seq[WorkerData] = {
val shutdownWorkers = runShowWorkers.getShutdownWorkers.asScala.toSeq
if (shutdownWorkers.isEmpty) {
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 b0ce832ec..4c529679d 100644
--- a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
+++ b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
@@ -166,6 +166,11 @@ class TestCelebornCliCommands extends CelebornFunSuite
with MiniClusterFeature {
captureOutputAndValidateResponse(args, "No excluded workers found.")
}
+ test("master --show-manual-excluded-workers") {
+ val args = prepareMasterArgs() :+ "--show-manual-excluded-workers"
+ captureOutputAndValidateResponse(args, "No manual excluded workers found.")
+ }
+
test("master --show-shutdown-workers") {
val args = prepareMasterArgs() :+ "--show-shutdown-workers"
captureOutputAndValidateResponse(args, "No shutdown workers found.")