GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/4823
[FLINK-7832] [flip6] Extend SlotManager to report free slots per TM
## What is the purpose of the change
Extend the `SlotManager` such that we count the free slots per
`TaskManager`. This has the advantage that we don't have to iterate over all
registered slots and aggregate their state in order to decide whether a
TaskManager is idle or not. Moreover, it allows to easily query how many free
slots every `TaskManager` still has.
## Brief change log
- Fail if slot belongs to a unregistered TaskManager
- Add more sanity checks
- Make the TaskManagerSlot state transitions clearer
- Introduce proper TaskManagerSlot state enum and state transitions
- Refactor SlotManager for better maintainability
- Add free slot counting
## Verifying this change
This change is already covered by existing tests, such as `SlotManagerTest`.
## 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 extendSlotManager
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4823.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 #4823
----
commit 77ece83513d9a79f2f0c3e7024d91243026c334c
Author: Till <[email protected]>
Date: 2017-10-13T07:19:51Z
[FLINK-7832] [flip6] Extend SlotManager to report free slots per TM
Fail if slot belongs to a unregistered TaskManager
Add more sanity checks
Make the TaskManagerSlot state transitions clearer
Introduce proper TaskManagerSlot state enum
Refactor SlotManager for better maintainability
----
---