azagrebin 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_r337400488
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
 ##########
 @@ -175,68 +215,78 @@ public ResourceProfile(ResourceProfile other) {
         * @return The cpu cores, 1.0 means a full cpu thread
         */
        public double getCpuCores() {
+               throwUnsupportedOperationExecptionIfUnknown();
                return cpuCores;
        }
 
        /**
-        * Get the heap memory needed in MB.
+        * Get the task heap memory needed.
         *
-        * @return The heap memory in MB
+        * @return The task heap memory
         */
-       public int getHeapMemoryInMB() {
-               return heapMemoryInMB;
+       public MemorySize getTaskHeapMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return taskHeapMemory;
        }
 
        /**
-        * Get the direct memory needed in MB.
+        * Get the task off-heap memory needed.
         *
-        * @return The direct memory in MB
+        * @return The task off-heap memory
         */
-       public int getDirectMemoryInMB() {
-               return directMemoryInMB;
+       public MemorySize getTaskOffHeapMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return taskOffHeapMemory;
        }
 
        /**
-        * Get the native memory needed in MB.
+        * Get the on-heap managed memory needed.
         *
-        * @return The native memory in MB
+        * @return The on-heap managed memory
         */
-       public int getNativeMemoryInMB() {
-               return nativeMemoryInMB;
+       public MemorySize getOnHeapManagedMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return onHeapManagedMemory;
        }
 
-       /**
-        * Get the memory needed for task to communicate with its upstreams and 
downstreams in MB.
-        * @return The network memory in MB
+       /**off
+        * Get the off-heap managed memory needed.
+        *
+        * @return The off-heap managed memory
         */
-       public int getNetworkMemoryInMB() {
-               return networkMemoryInMB;
+       public MemorySize getOffHeapManagedMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return offHeapManagedMemory;
        }
 
        /**
-        * Get the managed memory needed in MB.
-        * @return The managed memory in MB.
+        * Get the shuffle memory needed.
+        *
+        * @return The shuffle memory
         */
-       public int getManagedMemoryInMB() {
-               return managedMemoryInMB;
+       public MemorySize getShuffleMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return shuffleMemory;
        }
 
        /**
-        * Get the total memory needed in MB.
+        * Get the total memory needed.
         *
-        * @return The total memory in MB
+        * @return The total memory
         */
-       public int getMemoryInMB() {
-               return heapMemoryInMB + directMemoryInMB + nativeMemoryInMB + 
networkMemoryInMB + managedMemoryInMB;
+       public MemorySize getTotalMemory() {
+               throwUnsupportedOperationExecptionIfUnknown();
+               return 
taskHeapMemory.add(taskOffHeapMemory).add(onHeapManagedMemory).add(offHeapManagedMemory).add(shuffleMemory);
 
 Review comment:
   `return getOperatorsMemory().add(shuffleMemory);`

----------------------------------------------------------------
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

Reply via email to