Skip to content

Commit

Permalink
[CELEBORN-1593][FOLLOWUP] Support master --show-manual-excluded-worke…
Browse files Browse the repository at this point in the history
…rs command to show manual excluded workers
  • Loading branch information
SteNicholas committed Oct 9, 2024
1 parent 87822f6 commit 1e069d2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = _

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 1e069d2

Please sign in to comment.