flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] azagrebin commented on a change in pull request #9910: [FLINK-14405][runtime] Align ResourceProfile/ResourceSpec fields with the new TaskExecutor memory setups.
Date Tue, 22 Oct 2019 09:44:44 GMT
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_r337418778
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
 ##########
 @@ -98,58 +104,92 @@
 	 * Creates a new ResourceProfile.
 	 *
 	 * @param cpuCores The number of CPU cores (possibly fractional, i.e., 0.2 cores)
-	 * @param heapMemoryInMB The size of the heap memory, in megabytes.
-	 * @param directMemoryInMB The size of the direct memory, in megabytes.
-	 * @param nativeMemoryInMB The size of the native memory, in megabytes.
-	 * @param networkMemoryInMB The size of the memory for input and output, in megabytes.
-	 * @param managedMemoryInMB The size of managed memory, in megabytes.
+	 * @param taskHeapMemory The size of the task heap memory.
+	 * @param taskOffHeapMemory The size of the task off-heap memory.
+	 * @param onHeapManagedMemory The size of the on-heap managed memory.
+	 * @param offHeapManagedMemory The size of the off-heap managed memory.
+	 * @param shuffleMemory The size of the shuffle memory.
 	 * @param extendedResources The extended resources such as GPU and FPGA
 	 */
 	public ResourceProfile(
 			double cpuCores,
-			int heapMemoryInMB,
-			int directMemoryInMB,
-			int nativeMemoryInMB,
-			int networkMemoryInMB,
-			int managedMemoryInMB,
+			MemorySize taskHeapMemory,
+			MemorySize taskOffHeapMemory,
+			MemorySize onHeapManagedMemory,
+			MemorySize offHeapManagedMemory,
+			MemorySize shuffleMemory,
 			Map<String, Resource> extendedResources) {
-		Preconditions.checkArgument(cpuCores >= 0);
-		Preconditions.checkArgument(heapMemoryInMB >= 0);
-		Preconditions.checkArgument(directMemoryInMB >= 0);
-		Preconditions.checkArgument(nativeMemoryInMB >= 0);
-		Preconditions.checkArgument(networkMemoryInMB >= 0);
-		Preconditions.checkArgument(managedMemoryInMB >= 0);
 		this.cpuCores = cpuCores;
-		this.heapMemoryInMB = heapMemoryInMB;
-		this.directMemoryInMB = directMemoryInMB;
-		this.nativeMemoryInMB = nativeMemoryInMB;
-		this.networkMemoryInMB = networkMemoryInMB;
-		this.managedMemoryInMB = managedMemoryInMB;
+		this.taskHeapMemory = taskHeapMemory;
+		this.taskOffHeapMemory = taskOffHeapMemory;
+		this.onHeapManagedMemory = onHeapManagedMemory;
+		this.offHeapManagedMemory = offHeapManagedMemory;
+		this.shuffleMemory = shuffleMemory;
 		if (extendedResources != null) {
 			this.extendedResources.putAll(extendedResources);
 		}
 	}
 
+	/**
+	 * Creates a new ResourceProfile.
+	 *
+	 * @param cpuCores The number of CPU cores (possibly fractional, i.e., 0.2 cores)
+	 * @param taskHeapMemoryMB The size of the task heap memory, in megabytes.
+	 * @param taskOffHeapMemoryMB The size of the task off-heap memory, in megabytes.
+	 * @param onHeapManagedMemoryMB The size of the on-heap managed memory, in megabytes.
+	 * @param offHeapManagedMemoryMB The size of the off-heap managed memory, in megabytes.
+	 * @param shuffleMemoryMB The size of the shuffle memory, in megabytes.
+	 * @param extendedResources The extended resources such as GPU and FPGA
+	 */
+	public ResourceProfile(
 
 Review comment:
   These three constructors: @VisibleForTesting
   Ideally they should be rather part of some `ResourceProfile` builder in the test scope

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message