ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject [01/50] [abbrv] ambari git commit: AMBARI-21695. Problem in starting accumulo in upgraded cluster (IOP-HDP). UT fix. (swagle)
Date Mon, 09 Oct 2017 18:34:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/2.5-maint [created] fe71b2224


AMBARI-21695. Problem in starting accumulo in upgraded cluster (IOP-HDP). UT fix. (swagle)

(cherry picked from commit b02146cd5b3172de9081cbb43b46e54c715d0876)

Change-Id: I6f97a36fd0266c5a11146f002f7bb82b262d4baf


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

Branch: refs/heads/2.5-maint
Commit: 816ebb5880857bf3f8376d8d1d4e4bffcdb72cca
Parents: b8cb590
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Thu Aug 10 09:55:19 2017 -0700
Committer: swagle@hortonworks.com <jenkins@hortonworks.com>
Committed: Thu Aug 10 17:16:37 2017 +0000

----------------------------------------------------------------------
 .../listeners/upgrade/StackUpgradeFinishListener.java |  6 +++---
 .../upgrade/StackUpgradeFinishListenerTest.java       | 14 ++++++--------
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/816ebb58/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListener.java
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListener.java
index 41a0f35..7dd9754 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListener.java
@@ -53,7 +53,7 @@ public class StackUpgradeFinishListener {
   Provider<AmbariMetaInfo> ambariMetaInfo;
 
   @Inject
-  RoleCommandOrderProvider roleCommandOrderProvider;
+  Provider<RoleCommandOrderProvider> roleCommandOrderProvider;
 
   /**
    * Constructor.
@@ -88,9 +88,9 @@ public class StackUpgradeFinishListener {
       }
 
       // Clear the RoleCommandOrder cache on upgrade
-      if (roleCommandOrderProvider instanceof CachedRoleCommandOrderProvider) {
+      if (roleCommandOrderProvider.get() instanceof CachedRoleCommandOrderProvider) {
         LOG.info("Clearing RCO cache");
-        CachedRoleCommandOrderProvider cachedRcoProvider = (CachedRoleCommandOrderProvider)
roleCommandOrderProvider;
+        CachedRoleCommandOrderProvider cachedRcoProvider = (CachedRoleCommandOrderProvider)
roleCommandOrderProvider.get();
         cachedRcoProvider.clearRoleCommandOrderCache();
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/816ebb58/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListenerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListenerTest.java
index 94e5890..360f3f0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackUpgradeFinishListenerTest.java
@@ -17,35 +17,31 @@
  */
 package org.apache.ambari.server.events.listeners.upgrade;
 
-import static org.easymock.EasyMock.anyString;
 import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
 
-import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.events.StackUpgradeFinishEvent;
 import org.apache.ambari.server.events.publishers.VersionEventPublisher;
-import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
+import org.apache.ambari.server.metadata.RoleCommandOrderProvider;
 import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
 import org.apache.ambari.server.orm.entities.UpgradeEntity;
 import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.ServiceComponentHost;
-import org.apache.ambari.server.state.StackId;
-import org.apache.ambari.server.state.UpgradeState;
 import org.easymock.EasyMockRunner;
 import org.easymock.EasyMockSupport;
+import org.easymock.Mock;
+import org.easymock.MockType;
 import org.easymock.TestSubject;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.google.inject.Provider;
 
 
 /**
@@ -75,6 +71,8 @@ public class StackUpgradeFinishListenerTest extends EasyMockSupport {
   @TestSubject
   private StackUpgradeFinishListener listener = new StackUpgradeFinishListener(publisher);
 
+  @Mock(type = MockType.NICE)
+  private Provider<RoleCommandOrderProvider> roleCommandOrderProviderProviderMock;
 
   @Before
   public void setup() throws Exception {


Mime
View raw message