wangyang0918 commented on a change in pull request #10245:
[FLINK-10936][kubernetes] Implement Kubernetes command line tools to support
session cluster.
URL: https://github.com/apache/flink/pull/10245#discussion_r355179721
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/cli/AbstractCustomCommandLine.java
##########
@@ -89,4 +95,79 @@ public Configuration
applyCommandLineOptionsToConfiguration(CommandLine commandL
return resultingConfiguration;
}
+
+ protected void printUsage() {
+ System.out.println("Usage:");
+ HelpFormatter formatter = new HelpFormatter();
+ formatter.setWidth(200);
+ formatter.setLeftPadding(5);
+
+ formatter.setSyntaxPrefix(" Optional");
+ Options options = new Options();
+ addGeneralOptions(options);
+ addRunOptions(options);
+ formatter.printHelp(" ", options);
+ }
+
+ protected static int handleCliArgsException(CliArgsException e, Logger
logger) {
+ logger.error("Could not parse the command line arguments.", e);
+
+ System.out.println(e.getMessage());
+ System.out.println();
+ System.out.println("Use the help option (-h or --help) to get
help on the command.");
+ return 1;
+ }
+
+ protected static int handleError(Throwable t, Logger logger) {
+ logger.error("Error while running the Flink session.", t);
+
+ System.err.println();
+
System.err.println("------------------------------------------------------------");
+ System.err.println(" The program finished with the following
exception:");
+ System.err.println();
+
+ t.printStackTrace();
+ return 1;
+ }
+
+ /**
+ * Read-Evaluate-Print step for the REPL.
+ *
+ * @param in to read from
+ * @param readConsoleInput true if console input has to be read
+ * @param helpMessage help message
+ * @return true if the REPL shall be continued, otherwise false
+ */
+ protected static boolean repStep(
Review comment:
Currently, `FlinkKubernetesCustomCli` and `FlinkYarnSessionCli` share the
same `repStep`. Also, other custom command line may have different `resStep`. I
do not insist to move `repStep` to `AbstractCustomCommandLine` and could move
them out.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services