[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.
slfan1989 commented on code in PR #22028: URL: https://github.com/apache/flink/pull/22028#discussion_r1160653403 ## flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java: ## @@ -1265,11 +1266,9 @@ private ApplicationReport startAppMaster( if (appState != lastAppState) { LOG.info("Deploying cluster, current state " + appState); } -if (System.currentTimeMillis() - lastLogTime > 6) { -lastLogTime = System.currentTimeMillis(); +if (System.currentTimeMillis() - startTime > 6) { LOG.info( -"Deployment took more than {} seconds. Please check if the requested resources are available in the YARN cluster", -(lastLogTime - startTime) / 1000); +"Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster"); Review Comment: @1996fanrui @huwh Sorry, I didn't see the feedback question. When I rebase the master code later, I will be more careful. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.
slfan1989 commented on code in PR #22028: URL: https://github.com/apache/flink/pull/22028#discussion_r1132205743 ## flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java: ## @@ -170,6 +171,8 @@ public class YarnClusterDescriptor implements ClusterDescriptor { private YarnConfigOptions.UserJarInclusion userJarInclusion; +private static final long BYTES_IN_MB = 1024 * 1024; + Review Comment: Thanks for your suggestion, I will modify the code. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.
slfan1989 commented on code in PR #22028: URL: https://github.com/apache/flink/pull/22028#discussion_r1123982178 ## flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java: ## @@ -1441,13 +1444,17 @@ public String getClusterDescription() { totalMemory += res.getMemory(); totalCores += res.getVirtualCores(); ps.format(format, "NodeID", rep.getNodeId()); -ps.format(format, "Memory", res.getMemory() + " MB"); +ps.format(format, "Memory", getDisplayMemory(res.getMemory())); Review Comment: I will modify the code. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.
slfan1989 commented on code in PR #22028: URL: https://github.com/apache/flink/pull/22028#discussion_r1123981772 ## flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java: ## @@ -912,4 +913,17 @@ private Map getTestMasterEnv( appId.toString()); } } + +@Test +public void testByteDesc() { +long bytesInMB = 1024 * 1024; +// 128 MB +assertThat(StringUtils.byteDesc(bytesInMB * 128)).isEqualTo("128 MB"); +// 512 MB +assertThat(StringUtils.byteDesc(bytesInMB * 512)).isEqualTo("512 MB"); +// 1 GB +assertThat(StringUtils.byteDesc(bytesInMB * 1024)).isEqualTo("1 GB"); +// 128 GB +assertThat(StringUtils.byteDesc(bytesInMB * 131072)).isEqualTo("128 GB"); +} Review Comment: Thanks for your suggestion! I will modify the code. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.
slfan1989 commented on code in PR #22028: URL: https://github.com/apache/flink/pull/22028#discussion_r1123981772 ## flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java: ## @@ -912,4 +913,17 @@ private Map getTestMasterEnv( appId.toString()); } } + +@Test +public void testByteDesc() { +long bytesInMB = 1024 * 1024; +// 128 MB +assertThat(StringUtils.byteDesc(bytesInMB * 128)).isEqualTo("128 MB"); +// 512 MB +assertThat(StringUtils.byteDesc(bytesInMB * 512)).isEqualTo("512 MB"); +// 1 GB +assertThat(StringUtils.byteDesc(bytesInMB * 1024)).isEqualTo("1 GB"); +// 128 GB +assertThat(StringUtils.byteDesc(bytesInMB * 131072)).isEqualTo("128 GB"); +} Review Comment: Thank you for your suggestion! -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org