kw2542 commented on a change in pull request #1428: URL: https://github.com/apache/samza/pull/1428#discussion_r487278983
########## File path: samza-core/src/main/java/org/apache/samza/clustermanager/DefaultApplicationMain.java ########## @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.samza.clustermanager; + +import com.google.common.annotations.VisibleForTesting; +import joptsimple.OptionSet; +import org.apache.samza.application.ApplicationUtil; +import org.apache.samza.config.Config; +import org.apache.samza.runtime.ApplicationRunnerMain; +import org.apache.samza.util.ConfigUtil; + + +public class DefaultApplicationMain { + + public static void main(String[] args) { + run(args); + } + + @VisibleForTesting + static void run(String[] args) { + // This branch is ONLY for Yarn deployments, standalone apps uses offspring + final ApplicationRunnerMain.ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerMain.ApplicationRunnerCommandLine(); + cmdLine.parser().allowsUnrecognizedOptions(); Review comment: To answer your original questions, submission configs is a static list of configs predefined as they will impact how AM works, plus any extra config overrides user wants to supply in order to override the configs fetched in the `ConfigLoader`. The complete workflow will be: 1. submission configs are first passed to ClusterBasedJobCoordinatorRunner as System env variable and is retrieved with `final String submissionEnv = System.getenv(ShellCommandConfig.ENV_SUBMISSION_CONFIG);` 2.Afterwards, when ClusterBasedJobCoordinatorRunner invokes app.main.class, the above submission configs will be converted to `String[] args` as this is the only parameter that main() method takes. 3. Inside main() method, including both Beam and High/Low, args will be used to load full job config with `ConfigLoaderFactory` ---------------------------------------------------------------- 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]
