ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adorosz...@apache.org
Subject [09/39] ambari git commit: AMBARI-22325 Fix dependency injection in BaseClusterRequest (benyoka)
Date Fri, 24 Nov 2017 12:39:51 GMT
AMBARI-22325 Fix dependency injection in BaseClusterRequest (benyoka)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c9115909
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c9115909
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c9115909

Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: c9115909f5ece57ea39bce3669915df685041893
Parents: 8afa31e
Author: Balazs Bence Sari <benyoka@apache.org>
Authored: Mon Nov 13 14:55:16 2017 +0100
Committer: Doroszlai, Attila <adoroszlai@hortonworks.com>
Committed: Fri Nov 24 13:30:45 2017 +0100

----------------------------------------------------------------------
 .../org/apache/ambari/server/controller/AmbariServer.java   | 2 +-
 .../server/controller/internal/BaseClusterRequest.java      | 9 +++------
 .../apache/ambari/server/topology/BlueprintV2Factory.java   | 1 +
 3 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c9115909/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index b28cb11..970fb56 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -934,7 +934,7 @@ public class AmbariServer {
     HostResourceProvider.setTopologyManager(injector.getInstance(TopologyManager.class));
     BlueprintFactory.init(injector.getInstance(BlueprintDAO.class));
     BlueprintV2Factory.init(injector.getInstance(BlueprintV2DAO.class));
-    BaseClusterRequest.init(injector.getInstance(BlueprintV2Factory.class));
+    BaseClusterRequest.init(injector.getInstance(AmbariManagementController.class));
     AmbariContext.init(injector.getInstance(HostRoleCommandFactory.class));
 
     PermissionResourceProvider.init(injector.getInstance(PermissionDAO.class));

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9115909/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
index a38f478..eefb31b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
@@ -27,6 +27,7 @@ import java.util.Set;
 import org.apache.ambari.server.api.predicate.InvalidQueryException;
 import org.apache.ambari.server.api.predicate.QueryLexer;
 import org.apache.ambari.server.api.predicate.Token;
+import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
 import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
@@ -92,12 +93,8 @@ public abstract class BaseClusterRequest implements TopologyRequest {
   private static ResourceProvider hostResourceProvider;
 
 
-  /**
-   * inject blueprint factory
-   * @param factory  blueprint factory
-   */
-  public static void init(BlueprintV2Factory factory) {
-    blueprintFactory = factory;
+  public static void init(AmbariManagementController controller) {
+    blueprintFactory = BlueprintV2Factory.create(controller);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9115909/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
index 9870dcb..47aed80 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
@@ -82,6 +82,7 @@ public class BlueprintV2Factory {
   protected BlueprintV2Factory() {
 
   }
+
   protected BlueprintV2Factory(StackV2Factory stackFactory) {
     this.stackFactory = stackFactory;
   }


Mime
View raw message