From issues-return-147576-archive-asf-public=cust-asf.ponee.io@flink.apache.org Thu Jan 11 15:19:08 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 2454D180656 for ; Thu, 11 Jan 2018 15:19:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 14689160C20; Thu, 11 Jan 2018 14:19:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A3A6160C1F for ; Thu, 11 Jan 2018 15:19:07 +0100 (CET) Received: (qmail 23122 invoked by uid 500); 11 Jan 2018 14:19:06 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 23112 invoked by uid 99); 11 Jan 2018 14:19:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2018 14:19:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 025CF18062E for ; Thu, 11 Jan 2018 14:19:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.03 X-Spam-Level: X-Spam-Status: No, score=-4.03 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id vufA6MvDg83H for ; Thu, 11 Jan 2018 14:19:05 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 8CF6C5F3CC for ; Thu, 11 Jan 2018 14:19:04 +0000 (UTC) Received: (qmail 22669 invoked by uid 99); 11 Jan 2018 14:19:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2018 14:19:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0D4EFDFCFA; Thu, 11 Jan 2018 14:19:03 +0000 (UTC) From: tillrohrmann To: issues@flink.incubator.apache.org Reply-To: issues@flink.incubator.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #5225: [FLINK-8339] [flip6] Let CustomCommandLine return ... Content-Type: text/plain Message-Id: <20180111141904.0D4EFDFCFA@git1-us-west.apache.org> Date: Thu, 11 Jan 2018 14:19:03 +0000 (UTC) Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/5225#discussion_r160970724 --- Diff: flink-clients/src/main/java/org/apache/flink/client/cli/DefaultCLI.java --- @@ -51,45 +45,23 @@ public String getId() { } @Override - public void addRunOptions(Options baseOptions) { - } + public ClusterDescriptor createClusterDescriptor( + Configuration configuration, + String configurationDirectory, + CommandLine commandLine) { + final Configuration effectiveConfiguration = applyCommandLineOptionsToConfiguration(configuration, commandLine); - @Override - public void addGeneralOptions(Options baseOptions) { + return new StandaloneClusterDescriptor(effectiveConfiguration); } @Override - public StandaloneClusterClient retrieveCluster( - CommandLine commandLine, - Configuration config, - String configurationDirectory) { - - if (commandLine.hasOption(CliFrontendParser.ADDRESS_OPTION.getOpt())) { - String addressWithPort = commandLine.getOptionValue(CliFrontendParser.ADDRESS_OPTION.getOpt()); - InetSocketAddress jobManagerAddress = ClientUtils.parseHostPortAddress(addressWithPort); - setJobManagerAddressInConfig(config, jobManagerAddress); - } - - if (commandLine.hasOption(CliFrontendParser.ZOOKEEPER_NAMESPACE_OPTION.getOpt())) { - String zkNamespace = commandLine.getOptionValue(CliFrontendParser.ZOOKEEPER_NAMESPACE_OPTION.getOpt()); - config.setString(HighAvailabilityOptions.HA_CLUSTER_ID, zkNamespace); - } - - StandaloneClusterDescriptor descriptor = new StandaloneClusterDescriptor(config); - return descriptor.retrieve(null); + @Nullable + public String getClusterId(Configuration configuration, CommandLine commandLine) { + return "standalone"; } @Override - public StandaloneClusterClient createCluster( - String applicationName, - CommandLine commandLine, - Configuration config, - String configurationDirectory, - List userJarFiles) throws UnsupportedOperationException { - - StandaloneClusterDescriptor descriptor = new StandaloneClusterDescriptor(config); - ClusterSpecification clusterSpecification = ClusterSpecification.fromConfiguration(config); - - return descriptor.deploySessionCluster(clusterSpecification); + public ClusterSpecification getClusterSpecification(Configuration configuration, CommandLine commandLine) { + return new ClusterSpecification.ClusterSpecificationBuilder().createClusterSpecification(); --- End diff -- After thinking again about it, I think it's ok how it is. The unsupported operation is `StandaloneClusterDescriptor#deploySessionCluster`. But this has nothing to do with the `DefaultCLI#getClusterSpecification`. In the future it might very well be that we can also start a standalone cluster programmatically. ---