ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject svn commit: r1396389 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-server/src/main/java/org/apache/ambari/server/controller/ ambari-server/src/main/java/org/apache/ambari/server/state/cluster/
Date Tue, 09 Oct 2012 22:39:54 GMT
Author: hitesh
Date: Tue Oct  9 22:39:54 2012
New Revision: 1396389

URL: http://svn.apache.org/viewvc?rev=1396389&view=rev
Log:
AMBARI-837. Fix basic injection issues for controller impl. (Contributed by hitesh)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1396389&r1=1396388&r2=1396389&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Tue Oct  9 22:39:54 2012
@@ -227,6 +227,8 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-837. Fix basic injection issues for controller impl. (hitesh)
+
   AMBARI-836. Fix generation of requestId to be unique across restarts. (hitesh)
 
   AMBARI-834. Use RoleCommand instead of ServiceComponentHostEventType for HostAction

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1396389&r1=1396388&r2=1396389&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
Tue Oct  9 22:39:54 2012
@@ -42,7 +42,7 @@ import org.apache.ambari.server.state.sv
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.inject.assistedinject.Assisted;
+import com.google.inject.Inject;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -64,10 +64,12 @@ public class AmbariManagementControllerI
 
   private final ActionManager actionManager;
 
-  public AmbariManagementControllerImpl(@Assisted ActionManager actionManager
-      , @Assisted Clusters clusters) {
+  @Inject
+  public AmbariManagementControllerImpl(ActionManager actionManager,
+      Clusters clusters) {
     this.clusters = clusters;
     this.actionManager = actionManager;
+    LOG.info("Initializing the AmbariManagementControllerImpl");
   }
 
   @Override

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java?rev=1396389&r1=1396388&r2=1396389&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
Tue Oct  9 22:39:54 2012
@@ -27,6 +27,7 @@ import org.apache.ambari.server.actionma
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.security.CertificateManager;
+import org.apache.ambari.server.state.Clusters;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.security.SslSocketConnector;
 import org.mortbay.jetty.servlet.Context;
@@ -193,9 +194,15 @@ public class AmbariServer {
       serverForAgent.start();
 
       //Start action scheduler
+      LOG.info("********* Initializing Clusters **********");
+      Clusters clusters = injector.getInstance(Clusters.class);
       LOG.info("********* Started Server **********");
       ActionManager manager = injector.getInstance(ActionManager.class);
       manager.start();
+      LOG.info("********* Initializing Controller **********");
+      AmbariManagementController controller = injector.getInstance(
+          AmbariManagementController.class);
+
       server.join();
       LOG.info("Joined the Server");
     } catch (Exception e) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java?rev=1396389&r1=1396388&r2=1396389&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
Tue Oct  9 22:39:54 2012
@@ -47,5 +47,7 @@ public class ControllerModule extends Ab
     bind(ActionDBAccessor.class).to(ActionDBInMemoryImpl.class);
     bindConstant().annotatedWith(Names.named("schedulerSleeptime")).to(10000L);
     bindConstant().annotatedWith(Names.named("actionTimeout")).to(60000L);
+    bind(AmbariManagementController.class)
+        .to(AmbariManagementControllerImpl.class);
   }
 }

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java?rev=1396389&r1=1396388&r2=1396389&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
Tue Oct  9 22:39:54 2012
@@ -54,7 +54,7 @@ public class ClustersImpl implements Clu
     clustersById = new HashMap<Long, Cluster>();
     hosts = new HashMap<String, Host>();
     hostClusterMap = new HashMap<String, Set<Cluster>>();
-
+    LOG.info("Initializing the ClustersImpl");
   }
 
   @Override



Mime
View raw message