GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/4839
[FLINK-7851] [scheduling] Improve scheduling balance by round robin
distribution
## What is the purpose of the change
Polls in a round robin fashion from the slots multimap in
`SlotSharingGroupAssignment`. This will improve how tasks are spread out across
the available cluster resources if you have an operator with a smaller degree
of parallelism than other tasks.
## Brief change log
- Enforce that the available slot maps are of type `LinkeHashMap` to ensure
round robin traversal
- Change `SlotSharingGroupAssingment#pollFromMultiMap` such that it removes
the entry for a given `ResourceID`, takes a `SharedSlot` and then re-adds the
list of available slots if there is still one left. This will ensure that the
next time we remove the first iterator entry, we will take a slot from another
TaskManager if available.
## Verifying this change
- Added `SlotSharingGroupAssignmentTest#testRoundRobinPolling`
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tillrohrmann/flink roundRobinMultiMapPolling
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4839.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4839
----
commit 393fc965cd43e6b3e5948b7ede484e770e4e708a
Author: Till <[email protected]>
Date: 2017-10-16T14:18:23Z
[FLINK-7851] [scheduling] Improve scheduling balance by round robin
distribution
commit c58e07dbd9f0feab51a7327822446c9b69759ea7
Author: Till <[email protected]>
Date: 2017-10-16T14:38:43Z
Make sure that the value maps are of type LinkedHashMap in
SlotSharingGroupAssignment#availableSlotsPerJid
----
---