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:45 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_r337395412
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java
 ##########
 @@ -70,72 +70,88 @@
 	/** How many cpu cores are needed, use double so we can specify cpu like 0.1. */
 	private final double cpuCores;
 
-	/** How many java heap memory in mb are needed. */
-	private final int heapMemoryInMB;
+	/** How many task heap memory are needed. */
+	private final MemorySize taskHeapMemory;
 
-	/** How many nio direct memory in mb are needed. */
-	private final int directMemoryInMB;
+	/** How many task off-heap memory are needed. */
+	private final MemorySize taskOffHeapMemory;
 
-	/** How many native memory in mb are needed. */
-	private final int nativeMemoryInMB;
+	/** How many on-heap managed memory are needed. */
+	private final MemorySize onHeapManagedMemory;
 
-	/** How many state size in mb are used. */
-	private final int stateSizeInMB;
-
-	/** The required amount of managed memory (in MB). */
-	private final int managedMemoryInMB;
+	/** How many off-heap managed memory are needed. */
+	private final MemorySize offHeapManagedMemory;
 
 	private final Map<String, Resource> extendedResources = new HashMap<>(1);
 
 	/**
 	 * Creates a new ResourceSpec with full resources.
 	 *
 	 * @param cpuCores The number of CPU cores (possibly fractional, i.e., 0.2 cores)
-	 * @param heapMemoryInMB The size of the java heap memory, in megabytes.
-	 * @param directMemoryInMB The size of the java nio direct memory, in megabytes.
-	 * @param nativeMemoryInMB The size of the native memory, in megabytes.
-	 * @param stateSizeInMB The state size for storing in checkpoint.
-	 * @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 extendedResources The extended resources, associated with the resource manager
used
 	 */
 	private ResourceSpec(
-			double cpuCores,
-			int heapMemoryInMB,
-			int directMemoryInMB,
-			int nativeMemoryInMB,
-			int stateSizeInMB,
-			int managedMemoryInMB,
-			Resource... extendedResources) {
+		double cpuCores,
+		MemorySize taskHeapMemory,
+		MemorySize taskOffHeapMemory,
+		MemorySize onHeapManagedMemory,
+		MemorySize offHeapManagedMemory,
+		Resource... extendedResources) {
+
 		checkArgument(cpuCores >= 0, "The cpu cores of the resource spec should not be negative.");
-		checkArgument(heapMemoryInMB >= 0, "The heap memory of the resource spec should not
be negative");
-		checkArgument(directMemoryInMB >= 0, "The direct memory of the resource spec should
not be negative");
-		checkArgument(nativeMemoryInMB >= 0, "The native memory of the resource spec should
not be negative");
-		checkArgument(stateSizeInMB >= 0, "The state size of the resource spec should not be
negative");
-		checkArgument(managedMemoryInMB >= 0, "The managed memory of the resource spec should
not be negative");
 
 		this.cpuCores = cpuCores;
-		this.heapMemoryInMB = heapMemoryInMB;
-		this.directMemoryInMB = directMemoryInMB;
-		this.nativeMemoryInMB = nativeMemoryInMB;
-		this.stateSizeInMB = stateSizeInMB;
-		this.managedMemoryInMB = managedMemoryInMB;
+		this.taskHeapMemory = taskHeapMemory;
+		this.taskOffHeapMemory = taskOffHeapMemory;
+		this.onHeapManagedMemory = onHeapManagedMemory;
+		this.offHeapManagedMemory = offHeapManagedMemory;
 		for (Resource resource : extendedResources) {
 			if (resource != null) {
 				this.extendedResources.put(resource.getName(), resource);
 			}
 		}
 	}
 
+	/**
+	 * Creates a new ResourceSpec with full resources.
+	 *
+	 * @param cpuCores The number of CPU cores (possibly fractional, i.e., 0.2 cores)
+	 * @param taskHeapMemoryMB The size of the java heap memory, in megabytes.
+	 * @param taskOffHeapMemoryMB The size of the java nio direct memory, in megabytes.
+	 * @param onHeapManagedMemoryMB The size of the native memory, in megabytes.
+	 * @param offHeapManagedMemoryMB The state size for storing in checkpoint.
+	 * @param extendedResources The extended resources, associated with the resource manager
used
+	 */
 
 Review comment:
   So do we want these java docs for private constructors?
   Fields are already described before, where they are declared.

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