You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/11/05 16:37:04 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #10073: [FLINK-14560] [runtime] The value of taskmanager.memory.size in flink-conf.yaml is set to zero will cause taskmanager not to work

tillrohrmann commented on a change in pull request #10073: [FLINK-14560] [runtime] The value of taskmanager.memory.size in flink-conf.yaml is set to zero will cause taskmanager not to work
URL: https://github.com/apache/flink/pull/10073#discussion_r342666274
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java
 ##########
 @@ -42,28 +43,9 @@
 	 * @return managed memory size (in megabytes)
 	 */
 	public static long getManagedMemorySize(Configuration configuration) {
-		long managedMemorySize;
-		String managedMemorySizeDefaultVal = TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE.defaultValue();
-		if (!configuration.getString(TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE).equals(managedMemorySizeDefaultVal)) {
-			try {
-				managedMemorySize = MemorySize.parse(
-					configuration.getString(TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE), MEGA_BYTES).getMebiBytes();
-			} catch (IllegalArgumentException e) {
-				throw new IllegalConfigurationException("Could not read " + TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE
-
-					.key(), e);
-			}
-		} else {
-			managedMemorySize = Long.valueOf(managedMemorySizeDefaultVal);
-		}
-
-		checkConfigParameter(configuration.getString(
-			TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE).equals(TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE.defaultValue()) || managedMemorySize > 0,
-			managedMemorySize, TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE.key(),
-			"MemoryManager needs at least one MB of memory. " +
-				"If you leave this config parameter empty, the system automatically pick a fraction of the available memory.");
-
-		return managedMemorySize;
+		checkArgument(configuration.contains(TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE));
+		return MemorySize.parse(
+			configuration.getString(TaskManagerOptions.LEGACY_MANAGED_MEMORY_SIZE), MEGA_BYTES).getMebiBytes();
 
 Review comment:
   Same comments as https://github.com/apache/flink/pull/10090#pullrequestreview-311865775 apply here.

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