Merge branch 'develop' into feature/package_simplification_II Conflicts: slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/df352259 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/df352259 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/df352259 Branch: refs/heads/develop Commit: df35225987ca7c9e521f64af49c1b3ed3c03af43 Parents: 704e813 96177ed Author: Sumit Mohanty <smoha...@hortonworks.com> Authored: Tue Mar 17 21:08:32 2015 -0700 Committer: Sumit Mohanty <smoha...@hortonworks.com> Committed: Tue Mar 17 21:08:32 2015 -0700 ---------------------------------------------------------------------- .../hadoop-2.6.0-SNAPSHOT/bin/hadoop.dll | Bin 92672 -> 0 bytes bin/windows/hadoop-2.6.0-SNAPSHOT/bin/hdfs.dll | Bin 57344 -> 0 bytes .../hadoop-2.6.0-SNAPSHOT/bin/winutils.exe | Bin 108032 -> 0 bytes bin/windows/hadoop-2.6.0-SNAPSHOT/readme.md | 22 ------------------- bin/windows/hadoop-2.6.0/bin/hadoop.dll | Bin 92672 -> 0 bytes bin/windows/hadoop-2.6.0/bin/hadoop.pdb | Bin 502784 -> 0 bytes bin/windows/hadoop-2.6.0/bin/hdfs.dll | Bin 57344 -> 0 bytes bin/windows/hadoop-2.6.0/bin/hdfs.pdb | Bin 347136 -> 0 bytes bin/windows/hadoop-2.6.0/bin/winutils.exe | Bin 108032 -> 0 bytes bin/windows/hadoop-2.6.0/bin/winutils.pdb | Bin 896000 -> 0 bytes .../providers/agent/AgentProviderService.java | 11 +++++++++- .../web/rest/agent/ExecutionCommand.java | 10 +++++++++ 12 files changed, 20 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/df352259/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java ---------------------------------------------------------------------- diff --cc slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java index 4eadf13,8f6f3bf..d2298f0 --- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java +++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java @@@ -1698,21 -1660,20 +1699,28 @@@ public class AgentProviderService exten Map<String, Map<String, String>> configurations = buildCommandConfigurations(appConf, containerId, componentName); cmd.setConfigurations(configurations); - Map<String, Map<String, String>> componentConfigurations = buildComponentConfigurations(appConf); - cmd.setComponentConfigurations(componentConfigurations); - - cmd.setCommandParams(setCommandParameters(scriptPath, timeout, false)); + if(SliderUtils.isSet(scriptPath)) { + cmd.setCommandParams(commandParametersSet(scriptPath, timeout, false)); + } else { + // assume it to be default shell command + ComponentCommand effectiveCommand = compCmd; + if(effectiveCommand == null) { + effectiveCommand = ComponentCommand.getDefaultComponentCommand("INSTALL"); + } + cmd.setCommandParams(commandParametersSet(effectiveCommand, timeout, false)); + configurations.get("global").put("exec_cmd", effectiveCommand.getExec()); + } cmd.setHostname(getClusterInfoPropertyValue(StatusKeys.INFO_AM_HOSTNAME)); + response.addExecutionCommand(cmd); + + log.debug("command looks like: " + cmd.toString()); + } + + private Map<String, Map<String, String>> buildComponentConfigurations( + ConfTreeOperations appConf) { + return appConf.getComponents(); } protected static String getPackageListFromApplication(Application application) { @@@ -1864,21 -1804,17 +1872,22 @@@ cmd.setRoleParams(roleParams); cmd.getRoleParams().put("auto_restart", Boolean.toString(isMarkedAutoRestart)); - cmd.setCommandParams(setCommandParameters(scriptPath, timeout, true)); - - Map<String, Map<String, String>> componentConfigurations = buildComponentConfigurations(appConf); - cmd.setComponentConfigurations(componentConfigurations); - Map<String, Map<String, String>> configurations = buildCommandConfigurations(appConf, containerId, componentName); - cmd.setConfigurations(configurations); + + if(SliderUtils.isSet(scriptPath)) { + cmd.setCommandParams(commandParametersSet(scriptPath, timeout, true)); + } else { + if(startCommand == null) { + throw new SliderException("Expected START command not found for component " + componentName); + } + cmd.setCommandParams(commandParametersSet(startCommand, timeout, true)); + configurations.get("global").put("exec_cmd", startCommand.getExec()); + } + response.addExecutionCommand(cmd); - + + log.debug("command looks like: " + cmd.toString()); // With start command, the corresponding command for graceful stop needs to // be sent. This will be used when a particular container is lost as per RM, // but then the agent is still running and heart-beating to the Slider AM. http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/df352259/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/agent/ExecutionCommand.java ----------------------------------------------------------------------