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/14 08:11:24 UTC

[GitHub] [flink] xintongsong commented on a change in pull request #12110: [FLINK-17652][config] Legacy JM heap options should fallback to new JVM_HEAP_MEMORY in standalone

xintongsong commented on a change in pull request #12110:
URL: https://github.com/apache/flink/pull/12110#discussion_r424949205



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/bash/BashJavaUtils.java
##########
@@ -40,18 +43,28 @@
 	@VisibleForTesting
 	public static final String EXECUTION_PREFIX = "BASH_JAVA_UTILS_EXEC_RESULT:";
 
-	public static void main(String[] args) throws Exception {
+	private BashJavaUtils() {
+	}
+
+	public static void main(String[] args) throws FlinkException {
 		checkArgument(args.length > 0, "Command not specified.");
 
+		Command command = Command.valueOf(args[0]);
 		String[] commandArgs = Arrays.copyOfRange(args, 1, args.length);
+		Configuration configuration = FlinkConfigLoader.loadConfiguration(commandArgs);

Review comment:
       I'm not entirely sure about this refactor.
   
   I'm good with always take the first argument as the command, and always print the outputs with the prefix, because these are IMO common contract for all the `BashJavaUtils` commands.
   
   However, the assumption that the remaining arguments are used and only used for generating `Configuration` may not always be true. It is only true based on the current state with the `GET_JM/TM_RESOURCE_PARAMS` commands. This does not cause any problem ATM, but I think it might be better to pass in the `commandArgs` and generate `Configuration` inside `getJm/TmResourceParams`.




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