Skip to content

Commit

Permalink
rename WorkerDecommission message to DecommissionWorker. (CR feedback)
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Jul 24, 2020
1 parent 5678d28 commit 50b9cb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private[deploy] object DeployMessages {
* @param id the worker id
* @param worker the worker endpoint ref
*/
case class WorkerDecommission(
case class DecommissionWorker(
id: String,
worker: RpcEndpointRef)
extends DeployMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private[deploy] class Master(
logError("Leadership has been revoked -- master shutting down.")
System.exit(0)

case WorkerDecommission(id, workerRef) =>
case DecommissionWorker(id, workerRef) =>
logInfo("Recording worker %s decommissioning".format(id))
if (state == RecoveryState.STANDBY) {
workerRef.send(MasterInStandby)
Expand Down Expand Up @@ -874,7 +874,7 @@ private[deploy] class Master(

/**
* Decommission all workers that are active on any of the given hostnames. The decommissioning is
* asynchronously done by enqueueing WorkerDecommission messages to self. No checks are done about
* asynchronously done by enqueueing DecommissionWorker messages to self. No checks are done about
* the prior state of the worker. So an already decommissioned worker will match as well.
*
* @param hostnames: A list of hostnames without the ports. Like "localhost", "foo.bar.com" etc
Expand All @@ -893,7 +893,7 @@ private[deploy] class Master(
// The workers are removed async to avoid blocking the receive loop for the entire batch
workersToRemove.foreach(wi => {
logInfo(s"Sending the worker decommission to ${wi.id} and ${wi.endpoint}")
self.send(WorkerDecommission(wi.id, wi.endpoint))
self.send(DecommissionWorker(wi.id, wi.endpoint))
})

// Return the count of workers actually removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ private[deploy] class Worker(
finishedApps += id
maybeCleanupApplication(id)

case WorkerDecommission(_, _) =>
case DecommissionWorker(_, _) =>
decommissionSelf()
}

Expand Down Expand Up @@ -772,7 +772,7 @@ private[deploy] class Worker(
if (conf.get(WORKER_DECOMMISSION_ENABLED)) {
logDebug("Decommissioning self")
decommissioned = true
sendToMaster(WorkerDecommission(workerId, self))
sendToMaster(DecommissionWorker(workerId, self))
} else {
logWarning("Asked to decommission self, but decommissioning not enabled")
}
Expand Down

0 comments on commit 50b9cb2

Please sign in to comment.