GitHub user shuai-xu opened a pull request: https://github.com/apache/flink/pull/4911
[FLINK-7878] [api] make resource type extendible in ResourceSpec Summary: Now, flink only support user define CPU and MEM, but some user need to specify the GPU, FPGA and so on resources. So it need to make the resource type extendible in the ResourceSpec. Add a extend field for new resources. ## What is the purpose of the change This pull request adds a extensible filed to the ResourceSpec, so user can define variable resources only if supported by their resource manager. *(for example:)* user can use _text.flatMap().setResource(new ResourceSpce(1, 100, new ResourceSpce.Resource("GPU", 0.5)));_ to define their GPU requirement for the operator. ## Verifying this change This change added tests and can be verified as follows: - *Added unit tests ResourceSpecTest to verify. ## 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: (no) ## 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/shuai-xu/flink jira-7878 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4911.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 #4911 ---- commit 3e1d61a33f18b351424d4684cbaebc22674f582c Author: shuai.xus <shuai....@alibaba-inc.com> Date: 2017-10-25T06:56:35Z [FLINK-7878] [api] make resource type extendible in ResourceSpec Summary: Now, flink only support user define CPU and MEM, but some user need to specify the GPU, FPGA and so on resources. So it need to make the resouce type extendible in the ResourceSpec. Add a extend field for new resources. Test Plan: UnitTest Reviewers: haitao.w Differential Revision: https://aone.alibaba-inc.com/code/D327427 ---- ---