xintongsong commented on a change in pull request #8704: [FLINK-12812][runtime]
Set resource profiles for task slots
URL: https://github.com/apache/flink/pull/8704#discussion_r299408585
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java
##########
@@ -1191,8 +1197,32 @@ protected int getNumberRequiredTaskManagerSlots() {
// Helper methods
//
------------------------------------------------------------------------
- protected static Collection<ResourceProfile> createSlotsPerWorker(int
numSlots) {
- return Collections.nCopies(numSlots, ResourceProfile.ANY);
+ @VisibleForTesting
+ public static Collection<ResourceProfile>
createSlotsPerWorker(Configuration config, long totalMemoryMB, int numSlots) {
+ final long cutoffMB =
ContaineredTaskManagerParameters.calculateCutoffMB(config, totalMemoryMB);
+
+ final long networkMB =
NettyShuffleEnvironmentConfiguration.calculateNetworkBufferMemory(
Review comment:
I agree that we do not need to cover network memory in `ResourceProfile` in
this version. However, I'm afraid we need to access
`NettyShuffleEnvironmentConfiguration.calculateNetworkBufferMemory` on RM side
anyway. Otherwise, we can not calculate managed memory size from the total
container memory size. I think in the future we need a dedicated data structure
to unify all the task executor resource calculations, exposing accesses of
individual factors while hiding the detailed calculation steps.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services