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 2020/05/27 03:59:21 UTC

[GitHub] [flink] KarmaGYZ commented on a change in pull request #12315: [FLINK-17917][yarn] Ignore the external resource with a value of 0 in…

KarmaGYZ commented on a change in pull request #12315:
URL: https://github.com/apache/flink/pull/12315#discussion_r430118921



##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/ResourceInformationReflector.java
##########
@@ -151,7 +151,9 @@ void setResourceInformationUnSafe(Object resource, String resourceName, long amo
 			for (int i = 2; i < externalResourcesInfo.length; i++) {
 				final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]);
 				final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]);
-				externalResources.put(name, value);
+				if (value > 0) {
+					externalResources.put(name, value);
+				}

Review comment:
       Yes, you are right.

##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/ResourceInformationReflector.java
##########
@@ -151,7 +151,9 @@ void setResourceInformationUnSafe(Object resource, String resourceName, long amo
 			for (int i = 2; i < externalResourcesInfo.length; i++) {
 				final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]);
 				final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]);
-				externalResources.put(name, value);
+				if (value > 0) {
+					externalResources.put(name, value);
+				}

Review comment:
       Yes, you are right. I think filtering out entries with a value of 0 would be good enough.




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