Skip to content

Commit 548af88

Browse files
authored
Remove representative jobs from scenario info (#297)
1 parent 225b71e commit 548af88

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

pkg/scheduler/actions/common/solvers/scenario/base_scenario.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,15 @@ func (s *BaseScenario) appendTasksAsVictimJob(tasks []*pod_info.PodInfo) {
114114
s.victimsJobsTaskGroups[job.UID] = append(s.victimsJobsTaskGroups[job.UID], job)
115115

116116
victimTasks := make([]*pod_info.PodInfo, 0)
117-
victimJobs := make([]*podgroup_info.PodGroupInfo, 0)
118117
victim, found := s.victims[job.UID]
119118
if found {
120119
victimTasks = victim.Tasks
121-
victimJobs = victim.RepresentativeJobs
122120
}
123121
victimTasks = append(victimTasks, tasks...)
124-
victimJobs = append(victimJobs, job)
125122

126123
s.victims[job.UID] = &api.VictimInfo{
127-
Job: originalJob,
128-
RepresentativeJobs: victimJobs,
129-
Tasks: victimTasks,
124+
Job: originalJob,
125+
Tasks: victimTasks,
130126
}
131127
}
132128

pkg/scheduler/actions/consolidation/consolidation.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ func attemptToConsolidatePreemptor(
117117

118118
func allPodsReallocated(scenario api.ScenarioInfo) bool {
119119
for _, victim := range scenario.GetVictims() {
120-
for _, job := range victim.RepresentativeJobs {
121-
for _, task := range job.PodInfos {
122-
if task.Status == pod_status.Releasing {
123-
return false
124-
}
120+
for _, task := range victim.Tasks {
121+
if task.Status == pod_status.Releasing {
122+
return false
125123
}
126124
}
127125
}

pkg/scheduler/api/scenario_info.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ type ScenarioInfo interface {
1717
type VictimInfo struct {
1818
// Job is the original job that is being evicted, as it exists in the session
1919
Job *podgroup_info.PodGroupInfo
20-
// RepresentativeJob is a partial representation of the job that is being evicted. To be deprecated.
21-
RepresentativeJobs []*podgroup_info.PodGroupInfo
22-
// Tasks is the list of tasks that are being evicted.
20+
// Tasks is the list of tasks that are being evicted, as they exist in the session
2321
Tasks []*pod_info.PodInfo
2422
}

0 commit comments

Comments
 (0)