Repository: ambari
Updated Branches:
  refs/heads/trunk 8895386bc -> 64a3926fb


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


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

Branch: refs/heads/trunk
Commit: 64a3926fb430a128fbda63a3477f8330e2562c58
Parents: 8895386
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Thu Aug 10 08:52:02 2017 -0700
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Thu Aug 10 08:52:02 2017 -0700

----------------------------------------------------------------------
 .../events/listeners/upgrade/StackUpgradeFinishListener.java   | 4 ++--
 .../listeners/upgrade/StackUpgradeFinishListenerTest.java      | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/64a3926f/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 f1168a4..0146bdb 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,7 +88,7 @@ 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;
         cachedRcoProvider.clearRoleCommandOrderCache();

http://git-wip-us.apache.org/repos/asf/ambari/blob/64a3926f/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 759716a..c4b1f0b 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
@@ -25,6 +25,7 @@ import java.util.Map;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.events.StackUpgradeFinishEvent;
 import org.apache.ambari.server.events.publishers.VersionEventPublisher;
+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;
@@ -33,11 +34,14 @@ import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.ServiceComponentHost;
 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;
 
 
 /**
@@ -67,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 {

Reply via email to