craigcondit commented on code in PR #957:
URL: https://github.com/apache/yunikorn-core/pull/957#discussion_r1744079970


##########
pkg/scheduler/objects/allocation.go:
##########
@@ -565,3 +567,39 @@ func (a *Allocation) setUserQuotaCheckPassed() {
                a.askEvents.SendRequestFitsInUserQuota(a.allocationKey, 
a.applicationID, a.allocatedResource)
        }
 }
+
+func (a *Allocation) setPreemptionPreConditionsCheckPassed() {
+       a.Lock()
+       defer a.Unlock()
+       if a.preemptionPreConditionsCheckFailed {
+               a.preemptionPreConditionsCheckFailed = false
+               
a.askEvents.SendPreemptionPreConditionsCheckPassed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionPreConditionsCheckFailed() {
+       a.Lock()
+       defer a.Unlock()
+       if !a.preemptionPreConditionsCheckFailed {
+               a.preemptionPreConditionsCheckFailed = true
+               
a.askEvents.SendPreemptionPreConditionsCheckFailed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionQueueGuaranteesCheckPassed() {
+       a.Lock()
+       defer a.Unlock()
+       if a.preemptionQueueGuaranteesCheckFailed {
+               a.preemptionQueueGuaranteesCheckFailed = false
+               
a.askEvents.SendPreemptionQueueGuaranteesCheckPassed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionQueueGuaranteesCheckFailed() {
+       a.Lock()
+       defer a.Unlock()
+       if !a.preemptionQueueGuaranteesCheckFailed {
+               a.preemptionQueueGuaranteesCheckFailed = true
+               
a.askEvents.SendPreemptionQueueGuaranteesCheckFailed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}

Review Comment:
   Why not just reuse `AllocationLog`? It already contains events pertaining to 
things like predicate failures; preemption attempts can be tracked there easily 
as well.



-- 
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