-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prioritize task update based on their status #479
Conversation
If we ever need it, this could be easily updated to add deadlines ordering with iexec-core/src/main/java/com/iexec/core/task/update/TaskUpdateRequestManager.java Line 162 in d4a16b6
|
|
||
PriorityBlockingQueue<Task> createQueue() { | ||
// Tasks whose status are the more advanced should be computed before others | ||
final Comparator<Task> comparator = Comparator.comparing(task -> task.getCurrentStatus().ordinal(), Comparator.reverseOrder()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why sorting them by status instead of contribution deadline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we work with bag of tasks, every task has the same contributionDeadline
... But some of them may be more advanced in their statuses, so they have priority to be updated.
However, I agree with you on the fact that sorting tasks by contribution deadline may be great in addition to status ordering and that's something that should not be too hard to implement. See #479 (comment).
src/test/java/com/iexec/core/task/update/TaskUpdateRequestManagerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iexec/core/task/update/TaskUpdateRequestManager.java
Outdated
Show resolved
Hide resolved
src/test/java/com/iexec/core/task/update/TaskUpdateRequestManagerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iexec/core/task/update/TaskUpdateRequestManager.java
Outdated
Show resolved
Hide resolved
Why not something like:
? |
@jeremyjams: If you already have |
Implementation to discuss:
This may allow us to remove some bottlenecks and scheduling problems |
src/main/java/com/iexec/core/task/update/TaskUpdateRequestManager.java
Outdated
Show resolved
Hide resolved
* | ||
* @return A {@link Stream} as described above. | ||
*/ | ||
public Stream<TaskUpdate> streamAsTaskUpdate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
streamOfTaskUpdate()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like of
. The idea here is to tell that the elements in the queue are streamed as TaskUpdate
s. I don't think streamOfTaskUpdate
carries the same meaning: it tells this method returns a stream of TaskUpdate
s but does not say anything about where these objects come from.
src/main/java/com/iexec/core/task/update/TaskUpdateRequestManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well-done :)
src/test/java/com/iexec/core/task/update/TaskUpdateRequestManagerTests.java
Outdated
Show resolved
Hide resolved
…/iexec-core into feature/prioritize-task-update
src/main/java/com/iexec/core/task/update/TaskUpdatePriorityBlockingQueue.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this 👍
No description provided.