Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5225#discussion_r159702188
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java ---
@@ -457,7 +499,19 @@ protected int stop(String[] args) throws Exception {
final CustomCommandLine<?> activeCommandLine =
getActiveCustomCommandLine(commandLine);
- final ClusterClient client =
activeCommandLine.retrieveCluster(commandLine, configuration,
configurationDirectory);
+ final ClusterDescriptor<?> clusterDescriptor =
activeCommandLine.createClusterDescriptor(
--- End diff --
It seems that there is a pattern of getting the `clusterDescriptor` and and
the `client` for all the commands. Also shutting down the client and closing
the descriptor is repeated. Imo we should extract the pattern to avoid code
duplication.
---