adamantal commented on a change in pull request #175:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/175#discussion_r444255059



##########
File path: pkg/scheduler/scheduling_application.go
##########
@@ -163,6 +167,7 @@ func (sa *SchedulingApplication) 
removeAllocationAsk(allocKey string) int {
                deltaPendingResource = sa.pending
                sa.pending = resources.NewResource()
                sa.requests = make(map[string]*schedulingAllocationAsk)
+               sa.sortedRequestsDirty = true

Review comment:
       Why does the array turn to dirty when we remove an ask? I believe 
removing an element from a sorted list does not make the list unsorted.

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.
+The policy is not set directly on the application but inherited from the 
queue. 
+A sorting policy setting is only effective on a `leaf` queue.
+Each `leaf` queue can use a different policy.
+
+Requests are sorted but this is not a guarantee that a newer request will not 
be allocated before an older request.
+There might be cases that a request cannot be allocated immediately.
+In that case is a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  
+
+The following configuration entry sets the request sorting policy to 
`priority` for the queue `root.sandbox`: 
+```yaml
+partitions:
+  - name: default
+    queues:
+    - name: root
+      queues:
+      - name: sandbox
+        properties:
+          request.sort.policy: priority
+```
+
+### FifoSortPolicy
+Short description: first in first out, based on application create time  
+Config value: fifo (default)  
+Behaviour:  
+Before sorting the requests are filtered and must have pending asks.
+
+Requests are sorted based on the time the request was created only.

Review comment:
       ```suggestion
   Requests are sorted based on the time the request was created.
   ```

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.

Review comment:
       I would swap these two sentences. First let's state what a `request` is, 
and only then how can it be sorted.

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.
+The policy is not set directly on the application but inherited from the 
queue. 
+A sorting policy setting is only effective on a `leaf` queue.
+Each `leaf` queue can use a different policy.
+
+Requests are sorted but this is not a guarantee that a newer request will not 
be allocated before an older request.
+There might be cases that a request cannot be allocated immediately.
+In that case is a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  
+
+The following configuration entry sets the request sorting policy to 
`priority` for the queue `root.sandbox`: 
+```yaml
+partitions:
+  - name: default
+    queues:
+    - name: root
+      queues:
+      - name: sandbox
+        properties:
+          request.sort.policy: priority
+```
+
+### FifoSortPolicy
+Short description: first in first out, based on application create time  
+Config value: fifo (default)  
+Behaviour:  
+Before sorting the requests are filtered and must have pending asks.
+
+Requests are sorted based on the time the request was created only.
+The oldest request will be considered first.
+
+### PrioritySortPolicy
+Short description: sort requests from highest to the lowest   
+Config value: priority  
+Behaviour:  

Review comment:
       Could we reference here how can we set a priority for an ask?

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.
+The policy is not set directly on the application but inherited from the 
queue. 
+A sorting policy setting is only effective on a `leaf` queue.
+Each `leaf` queue can use a different policy.
+
+Requests are sorted but this is not a guarantee that a newer request will not 
be allocated before an older request.
+There might be cases that a request cannot be allocated immediately.
+In that case is a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  

Review comment:
       ```suggestion
   In that case a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  
   ```

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.
+The policy is not set directly on the application but inherited from the 
queue. 
+A sorting policy setting is only effective on a `leaf` queue.
+Each `leaf` queue can use a different policy.
+
+Requests are sorted but this is not a guarantee that a newer request will not 
be allocated before an older request.
+There might be cases that a request cannot be allocated immediately.
+In that case is a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  
+
+The following configuration entry sets the request sorting policy to 
`priority` for the queue `root.sandbox`: 
+```yaml
+partitions:
+  - name: default
+    queues:
+    - name: root
+      queues:
+      - name: sandbox
+        properties:
+          request.sort.policy: priority
+```
+
+### FifoSortPolicy
+Short description: first in first out, based on application create time  
+Config value: fifo (default)  
+Behaviour:  
+Before sorting the requests are filtered and must have pending asks.
+
+Requests are sorted based on the time the request was created only.
+The oldest request will be considered first.
+
+### PrioritySortPolicy
+Short description: sort requests from highest to the lowest   

Review comment:
       ```suggestion
   Short description: sorts requests from highest to the lowest   
   ```

##########
File path: docs/sorting_policy.md
##########
@@ -143,8 +143,45 @@ This results in a node with the highest utilisation to be 
considered first for a
 Resulting in a high(er) utilisation of a small(er) number of nodes, better 
suited for cloud deployments.   
 
 ## Request sorting
-There is currently one policy for sorting requests within an application.
-This policy is not configurable.
-Sorting requests is only possible based on the priority of the request.
-If there are multiple requests within an application that have the same 
priority the order of the requests is undetermined.
-This means that the order of requests with the same priority can, and most 
likely will, change between runs.
\ No newline at end of file
+There are currently two policies for sorting requests within an application.
+A request is an ask from an application which maps to one or more pods or 
containers.
+The policy is not set directly on the application but inherited from the 
queue. 
+A sorting policy setting is only effective on a `leaf` queue.
+Each `leaf` queue can use a different policy.
+
+Requests are sorted but this is not a guarantee that a newer request will not 
be allocated before an older request.
+There might be cases that a request cannot be allocated immediately.
+In that case is a newer request might be allocated before an older request 
(i.e. a reservation for an old request).  
+
+The following configuration entry sets the request sorting policy to 
`priority` for the queue `root.sandbox`: 
+```yaml
+partitions:
+  - name: default
+    queues:
+    - name: root
+      queues:
+      - name: sandbox
+        properties:
+          request.sort.policy: priority
+```
+
+### FifoSortPolicy
+Short description: first in first out, based on application create time  
+Config value: fifo (default)  
+Behaviour:  
+Before sorting the requests are filtered and must have pending asks.

Review comment:
       I don't understand this sentence. Earlier we said the request is an ask 
from an application.  How can a request have a pending ask?
   
   Also, do we filter the applications then? We should be more explicit here.




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