wilfred-s commented on a change in pull request #152:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/152#discussion_r432488091



##########
File path: pkg/cache/application_info.go
##########
@@ -73,6 +73,23 @@ func (ai *ApplicationInfo) GetAllAllocations() 
[]*AllocationInfo {
        return allocations
 }
 
+// Return the allocation for the allocation key. This will return the first 
allocation for the
+// allocation key. It will only work for the case that the repeat is 1.
+func (ai *ApplicationInfo) GetAllocationUUID(allocKey string) string {
+       ai.lock.RLock()
+       defer ai.lock.RUnlock()
+
+       // just get the first one, ignore multiple repeats for now.
+       // we cannot detect multiple repeats easily here.
+       for uuid, alloc := range ai.allocations {
+               if alloc.AllocationProto.AllocationKey == allocKey {
+                       return uuid
+               }
+       }
+       // not found return an empty string
+       return ""
+}
+

Review comment:
       New commit has a simple fix by passing back the UUID of the allocation 
in the proposal instead of the whole allocation with all the things that hang 
of it.




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

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


Reply via email to