[Cuebot] Add FIFO scheduling capability #1060
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will address #1059
Frame scheduling
by adding FIFO scheduling capability.What I mean by
FIFO scheduling
isthe oldest frame will run first if the priority is the same
, which is commonly expected in job scheduling system.Changes
Environment
toDispatcherDaoJdbc
to setfifoSchedulingEnabled
variable bydispatcher.fifo_scheduling_enabled
property. The default value isfalse
. So the default scheduling behavior will not change.ORDER BY
s toFIND_JOBS_BY_SHOW/GROUP
to order/sort iffifoSchedulingEnabled
istrue
, the highest priority job first, the oldest job next.List
instead ofSet
to keep the job order in the SQL Query result.fifoSchedulingEnabled
isfalse
and the scheduling is not FIFO. If it is set totrue
, verify the FIFO scheduling is working.Behavior
The FIFO scheduling behavior would not be 100% perfect. There would be multiple Cuebot instances and multiple threads to schedule frames simultaneously. It cannot guarantee the oldest frame will run first. But this FIFO scheduling is almost working as expected.
The runtime cost should be almost identical with/without FIFO scheduling since the
findDispatchJobs
doesn't use much jobs at the same time.