xintongsong commented on a change in pull request #9910: [FLINK-14405][runtime]
Align ResourceProfile/ResourceSpec fields with the new TaskExecutor memory
setups.
URL: https://github.com/apache/flink/pull/9910#discussion_r335800874
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
##########
@@ -64,30 +64,30 @@
* A ResourceProfile that indicates infinite resource that matches any
resource requirement, for testability purpose only.
* */
@VisibleForTesting
- public static final ResourceProfile INFINITE = new
ResourceProfile(Double.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE,
Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE,
Collections.emptyMap());
+ public static final ResourceProfile INFINITE = new
ResourceProfile(Double.MAX_VALUE, MemorySize.MAX_VALUE, MemorySize.MAX_VALUE,
MemorySize.MAX_VALUE, MemorySize.MAX_VALUE, MemorySize.MAX_VALUE,
Collections.emptyMap());
/** A ResourceProfile describing zero resources. */
- public static final ResourceProfile ZERO = new ResourceProfile(0, 0);
+ public static final ResourceProfile ZERO = new ResourceProfile(0,
MemorySize.ZERO);
//
------------------------------------------------------------------------
/** How many cpu cores are needed, use double so we can specify cpu
like 0.1. */
private final double cpuCores;
- /** How many heap memory in mb are needed. */
- private final int heapMemoryInMB;
+ /** How many task heap memory are needed. */
+ private final MemorySize taskHeapMemory;
- /** How many direct memory in mb are needed. */
- private final int directMemoryInMB;
+ /** How many task off-heap memory are needed. */
+ private final MemorySize taskOffHeapMemory;
Review comment:
- `MemorySize` is facing users. Actually, it's annotated with
`@PublicEvolving`.
- `ResourceProfile` is not facing Flink users. It's used in runtime only.
- `ResourceSpec` is annotated `@Internal` for the moment, and we do not have
public interfaces allowing users to directly set `ResourceSpec` at the moment.
Only blink optimizer is setting it for the users according to their configs. In
the future, if we decide to expose interfaces to users for directly setting
operator resource requirements (e.g., in DataStream API), it is possible to
make `ResourceSpec` user facing.
----------------------------------------------------------------
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