Skip to content

Commit

Permalink
[SPARK-50971][CORE] Combine the two retrievals of taskDescription i…
Browse files Browse the repository at this point in the history
…n `CoarseGrainedExecutorBackend#statusUpdate`

### What changes were proposed in this pull request?
This PR reduces the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate` to one.

### Why are the changes needed?
Combine the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
- Pass GitHub Acitions

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #49638 from LuciferYang/taskDescription.

Authored-by: yangjie01 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 1569c8a)
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
LuciferYang authored and dongjoon-hyun committed Jan 24, 2025
1 parent 34308fc commit 38e39cb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ private[spark] class CoarseGrainedExecutorBackend(
}

override def statusUpdate(taskId: Long, state: TaskState, data: ByteBuffer): Unit = {
val resources = executor.runningTasks.get(taskId).taskDescription.resources
val cpus = executor.runningTasks.get(taskId).taskDescription.cpus
val taskDescription = executor.runningTasks.get(taskId).taskDescription
val resources = taskDescription.resources
val cpus = taskDescription.cpus
val msg = StatusUpdate(executorId, taskId, state, data, cpus, resources)
if (TaskState.isFinished(state)) {
lastTaskFinishTime.set(System.nanoTime())
Expand Down

0 comments on commit 38e39cb

Please sign in to comment.