Repository: ambari Updated Branches: refs/heads/trunk 4540d4611 -> 46abb14ce
AMBARI-16225. Blueprint Deployed Clusters Throw Exceptions On Startup. (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46abb14c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46abb14c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46abb14c Branch: refs/heads/trunk Commit: 46abb14ce88ca2bea043c0b9b4090cfdceaaf6c4 Parents: 4540d46 Author: Sandor Magyari <smagy...@hortonworks.com> Authored: Mon May 2 18:47:45 2016 +0200 Committer: Sandor Magyari <smagy...@hortonworks.com> Committed: Wed May 4 12:32:24 2016 +0200 ---------------------------------------------------------------------- .../org/apache/ambari/server/topology/TopologyManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/46abb14c/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java index e74a5f2..e3f5b49 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java @@ -36,6 +36,7 @@ import javax.inject.Inject; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.actionmanager.HostRoleCommand; import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorBlueprintProcessor; +import org.apache.ambari.server.controller.AmbariServer; import org.apache.ambari.server.controller.RequestStatusResponse; import org.apache.ambari.server.controller.internal.ArtifactResourceProvider; import org.apache.ambari.server.controller.internal.CalculatedStatus; @@ -257,7 +258,7 @@ public class TopologyManager { Map<String, String> requestInfoProps = new HashMap<>(); requestInfoProps.put(org.apache.ambari.server.controller.spi.Request.REQUEST_INFO_BODY_PROPERTY, - "{\"" + ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY + "\": " + descriptor + "}"); + "{\"" + ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY + "\": " + descriptor + "}"); org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.<String>emptySet(), Collections.singleton(properties), requestInfoProps, null); @@ -383,6 +384,9 @@ public class TopologyManager { * @param host */ public void onHostHeartBeatLost(Host host) { + if (AmbariServer.getController() == null) { + return; + } ensureInitialized(); synchronized (availableHosts) { LOG.info("Hearbeat for host {} lost thus removing it from available hosts.", host.getHostName());