manirajv06 commented on code in PR #1061:
URL: https://github.com/apache/yunikorn-core/pull/1061#discussion_r2697219304


##########
pkg/scheduler/objects/quota_preemptor.go:
##########
@@ -231,72 +219,72 @@ func (qcp *QuotaChangePreemptionContext) 
filterAllocations() []*Allocation {
                        if alloc.IsPreempted() {
                                continue
                        }
-                       allocations = append(allocations, alloc)
+                       qpc.allocations = append(qpc.allocations, alloc)
                }
        }
        log.Log(log.SchedQuotaChangePreemption).Info("Filtering allocations",
-               zap.String("queue", qcp.queue.GetQueuePath()),
-               zap.Int("filtered allocations", len(allocations)),
+               zap.String("queue", qpc.queue.GetQueuePath()),
+               zap.Int("filtered allocations", len(qpc.allocations)),
        )
-       return allocations
 }
 
 // sortAllocations Sort the allocations running in the queue
-func (qcp *QuotaChangePreemptionContext) sortAllocations() {
-       if len(qcp.allocations) > 0 {
-               SortAllocations(qcp.allocations)
+func (qpc *QuotaPreemptionContext) sortAllocations() {
+       if len(qpc.allocations) > 0 {
+               SortAllocations(qpc.allocations)
        }
 }
 
 // preemptVictims Preempt the victims to enforce the new max resources.
 // When both max and guaranteed resources are set and equal, to comply with 
law of preemption "Ensure usage doesn't go below guaranteed resources",
 // preempt victims on best effort basis. So, preempt victims as close as 
possible to the required resource.
 // Otherwise, exceeding above the required resources slightly is acceptable 
for now.
-func (qcp *QuotaChangePreemptionContext) preemptVictims() {
-       if len(qcp.allocations) == 0 {
+func (qpc *QuotaPreemptionContext) preemptVictims() {
+       if len(qpc.allocations) == 0 {
                log.Log(log.SchedQuotaChangePreemption).Warn("BUG: No victims 
to enforce quota change through preemption",
-                       zap.String("queue", qcp.queue.GetQueuePath()))
+                       zap.String("queue", qpc.queue.GetQueuePath()))
                return
        }
        apps := make(map[*Application][]*Allocation)
        victimsTotalResource := resources.NewResource()
        log.Log(log.SchedQuotaChangePreemption).Info("Found victims for quota 
change preemption",
-               zap.String("queue", qcp.queue.GetQueuePath()),
-               zap.Int("total victims", len(qcp.allocations)),
-               zap.String("max resources", qcp.maxResource.String()),
-               zap.String("guaranteed resources", 
qcp.guaranteedResource.String()),
-               zap.String("allocated resources", 
qcp.allocatedResource.String()),
-               zap.String("preemptable resources", 
qcp.preemptableResource.String()),
-               zap.Bool("isGuaranteedSet", qcp.guaranteedResource.IsEmpty()),
+               zap.String("queue", qpc.queue.GetQueuePath()),
+               zap.Int("total victims", len(qpc.allocations)),
+               zap.Stringer("max resources", qpc.maxResource),
+               zap.Stringer("guaranteed resources", qpc.guaranteedResource),
+               zap.Stringer("allocated resources", qpc.allocatedResource),
+               zap.Stringer("preemptable resources", qpc.preemptableResource),
+               zap.Bool("isGuaranteedSet", qpc.guaranteedResource.IsEmpty()),
        )
-       for _, victim := range qcp.allocations {
-               if 
!qcp.preemptableResource.FitInMaxUndef(victim.GetAllocatedResource()) {
+       for _, victim := range qpc.allocations {
+               victimALloc := victim.GetAllocatedResource()

Review Comment:
   Sorry, I meant `upper case` for letter 'l' in `ALloc`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to