GitHub user summerleafs opened a pull request:
https://github.com/apache/flink/pull/4369
[Flink-7218] [JobManager]
ExecutionVertex.getPreferredLocationsBasedOnInputs() will always return empty
I really like the new PR template, so i use it instead of the default one
on github~
## What is the purpose of the change
The ExecutionVertex.getPreferredLocationsBasedOnInputs will always return
empty, cause `sourceSlot` always be null until `ExectionVertex` has been
deployed via 'Execution.deployToSlot()'. So allocate resource base on preferred
location can't work correctly, we need to set the slot info for `Execution` as
soon as Execution.allocateSlotForExecution() called successfully.
## Brief change log
- Added a field `assignedFutureSlot` in `Execution` to record the
`Future<SimpleSlot>` as soon as `Execution.allocateSlotForExecution()` called
successfully. And the `assignedFutureSlot` will be used in `ExectionVertex.
getPreferredLocationsBasedOnInputs ()` to get ExecutionVertex's preferred
locations.
## Verifying this change
This change added tests and can be verified as follows:
- The test case is under ExecutionGraphSchedulingTest.
testExecutionVertexGetPreferredLocationsBasedOnInputs(), i have simulated the
process of the JobGraph deployment and validated the results in this test case.
## 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: **(don't know)**
- 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)**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/summerleafs/flink FLINK-7218
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4369.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 #4369
----
commit 3573b0f306071f53b31f272ba97eb36593318365
Author: summerleafs <[email protected]>
Date: 2017-07-18T17:43:01Z
Fix #FLINK-7218: add test for
ExecutionVertex.getPreferdLocationBaseOnInputs() method.
commit 29fe921552c232becb885d4f9eb454e15ded3eab
Author: summerleafs <[email protected]>
Date: 2017-07-19T14:02:53Z
Add test case for #FLINK-7218.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---