ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: Revert "AMBARI-17343. Blueprint attribute provision_action=INSTALL_ONLY loses its value after server restart (magyari_sandor)"
Date Mon, 27 Jun 2016 20:59:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 ad23a68e0 -> 818de68ae


Revert "AMBARI-17343. Blueprint attribute provision_action=INSTALL_ONLY loses its value after
server restart (magyari_sandor)"

This reverts commit 35f1f00cf2351cd7a1b39f9ddcb0c8d74fbc6255.


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

Branch: refs/heads/branch-2.4
Commit: 818de68ae4216c975dcb93e29860f9ba0dc2e052
Parents: ad23a68
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Jun 27 13:59:18 2016 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Jun 27 13:59:18 2016 -0700

----------------------------------------------------------------------
 .../controller/internal/BaseClusterRequest.java   | 18 ------------------
 .../internal/ProvisionClusterRequest.java         | 17 ++++++++++++++++-
 .../orm/entities/TopologyRequestEntity.java       | 16 ----------------
 .../ambari/server/topology/PersistedState.java    |  4 +---
 .../server/topology/PersistedStateImpl.java       | 13 ++-----------
 .../ambari/server/upgrade/UpgradeCatalog240.java  |  9 ---------
 .../main/resources/Ambari-DDL-Postgres-CREATE.sql |  1 -
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql       |  1 -
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql   |  1 -
 .../resources/Ambari-DDL-SQLServer-CREATE.sql     |  1 -
 .../internal/ClusterResourceProviderTest.java     |  2 +-
 .../ambari/server/state/cluster/ClustersTest.java |  5 ++---
 .../server/upgrade/UpgradeCatalog240Test.java     | 13 ++-----------
 13 files changed, 24 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/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 54389da..a67317a 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
@@ -42,17 +42,10 @@ import java.util.Set;
  */
 public abstract class BaseClusterRequest implements TopologyRequest {
   /**
-   * Support for controlling whether Install and Start tasks are created on
-   * blueprint deploy by default.
-   */
-  public static final String PROVISION_ACTION_PROPERTY = "provision_action";
-  /**
    * host group info map
    */
   protected final Map<String, HostGroupInfo> hostGroupInfoMap = new HashMap<String,
HostGroupInfo>();
 
-  protected ProvisionAction provisionAction;
-
   /**
    * cluster id
    */
@@ -192,15 +185,4 @@ public abstract class BaseClusterRequest implements TopologyRequest {
     }
     return hostResourceProvider;
   }
-
-  /**
-   * Get requested @ProvisionClusterRequest.ProvisionAction
-   */
-  public ProvisionAction getProvisionAction() {
-    return provisionAction;
-  }
-
-  public void setProvisionAction(ProvisionAction provisionAction) {
-    this.provisionAction = provisionAction;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
index a35da86..3feac55 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
@@ -101,6 +101,12 @@ public class ProvisionClusterRequest extends BaseClusterRequest {
   public static final String CONFIG_RECOMMENDATION_STRATEGY = "config_recommendation_strategy";
 
   /**
+   * Support for controlling whether Install and Start tasks are created on
+   * blueprint deploy by default.
+   */
+  public static final String PROVISION_ACTION_PROPERTY = "provision_action";
+
+  /**
    * The repo version to use
    */
   public static final String REPO_VERSION_PROPERTY = "repository_version";
@@ -128,6 +134,8 @@ public class ProvisionClusterRequest extends BaseClusterRequest {
    */
   private final ConfigRecommendationStrategy configRecommendationStrategy;
 
+  private final ProvisionAction provisionAction;
+
   private String repoVersion;
 
   private final static Logger LOG = LoggerFactory.getLogger(ProvisionClusterRequest.class);
@@ -172,7 +180,7 @@ public class ProvisionClusterRequest extends BaseClusterRequest {
 
     this.configRecommendationStrategy = parseConfigRecommendationStrategy(properties);
 
-    setProvisionAction(parseProvisionAction(properties));
+    this.provisionAction = parseProvisionAction(properties);
   }
 
   private Map<String, Credential> parseCredentials(Map<String, Object> properties)
throws
@@ -433,6 +441,13 @@ public class ProvisionClusterRequest extends BaseClusterRequest {
   }
 
   /**
+   * Get requested @ProvisionClusterRequest.ProvisionAction
+   */
+  public ProvisionAction getProvisionAction() {
+    return provisionAction;
+  }
+
+  /**
    * @return the repository version, if any
    */
   public String getRepositoryVersion() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
index 8e3fb25..923ff9c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
@@ -21,8 +21,6 @@ import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
@@ -36,8 +34,6 @@ import javax.persistence.Table;
 import javax.persistence.TableGenerator;
 import java.util.Collection;
 
-import org.apache.ambari.server.controller.internal.ProvisionAction;
-
 @Entity
 @Table(name = "topology_request")
 @TableGenerator(name = "topology_request_id_generator", table = "ambari_sequences",
@@ -80,10 +76,6 @@ public class TopologyRequestEntity {
   @OneToOne(mappedBy = "topologyRequestEntity", cascade = CascadeType.ALL)
   private TopologyLogicalRequestEntity topologyLogicalRequestEntity;
 
-  @Column(name = "provision_action", nullable = true)
-  @Enumerated(EnumType.STRING)
-  private ProvisionAction provisionAction;
-
   public Long getId() {
     return id;
   }
@@ -156,14 +148,6 @@ public class TopologyRequestEntity {
     this.topologyLogicalRequestEntity = topologyLogicalRequestEntity;
   }
 
-  public ProvisionAction getProvisionAction() {
-    return provisionAction;
-  }
-
-  public void setProvisionAction(ProvisionAction provisionAction) {
-    this.provisionAction = provisionAction;
-  }
-
   @Override
   public boolean equals(Object o) {
     if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedState.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedState.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedState.java
index 8003268..41fa032 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedState.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedState.java
@@ -21,8 +21,6 @@ package org.apache.ambari.server.topology;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.ambari.server.controller.internal.BaseClusterRequest;
-import org.apache.ambari.server.controller.internal.ProvisionClusterRequest;
 import org.apache.ambari.server.state.Host;
 
 /**
@@ -37,7 +35,7 @@ public interface PersistedState {
    * @return a persisted topology request which is a wrapper around a TopologyRequest which
    * adds an id that can be used to refer to the persisted entity
    */
-  PersistedTopologyRequest persistTopologyRequest(BaseClusterRequest topologyRequest);
+  PersistedTopologyRequest persistTopologyRequest(TopologyRequest topologyRequest);
 
   /**
    * Persist a logical request.

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
index bd9a9f7..ca81418 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
@@ -23,8 +23,6 @@ import com.google.inject.Inject;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.api.predicate.InvalidQueryException;
-import org.apache.ambari.server.controller.internal.BaseClusterRequest;
-import org.apache.ambari.server.controller.internal.ProvisionClusterRequest;
 import org.apache.ambari.server.orm.dao.HostDAO;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
 import org.apache.ambari.server.orm.dao.TopologyHostGroupDAO;
@@ -99,7 +97,7 @@ public class PersistedStateImpl implements PersistedState {
 
 
   @Override
-  public  PersistedTopologyRequest persistTopologyRequest(BaseClusterRequest request) {
+  public  PersistedTopologyRequest persistTopologyRequest(TopologyRequest request) {
     TopologyRequestEntity requestEntity = toEntity(request);
     topologyRequestDAO.create(requestEntity);
     return new PersistedTopologyRequest(requestEntity.getId(), request);
@@ -180,9 +178,6 @@ public class PersistedStateImpl implements PersistedState {
       if (clusterTopology == null) {
         try {
           clusterTopology = new ClusterTopologyImpl(ambariContext, replayedRequest);
-          if (entity.getProvisionAction() != null) {
-            clusterTopology.setProvisionAction(entity.getProvisionAction());
-          }
           topologyRequests.put(replayedRequest.getClusterId(), clusterTopology);
           allRequests.put(clusterTopology, new ArrayList<LogicalRequest>());
         } catch (InvalidTopologyException e) {
@@ -216,7 +211,7 @@ public class PersistedStateImpl implements PersistedState {
     return allRequests;
   }
 
-  private TopologyRequestEntity toEntity(BaseClusterRequest request) {
+  private TopologyRequestEntity toEntity(TopologyRequest request) {
     TopologyRequestEntity entity = new TopologyRequestEntity();
 
     //todo: this isn't set for a scaling operation because we had intended to allow multiple
@@ -232,10 +227,6 @@ public class PersistedStateImpl implements PersistedState {
     entity.setClusterProperties(propertiesAsString(request.getConfiguration().getProperties()));
     entity.setDescription(request.getDescription());
 
-    if (request.getProvisionAction() != null) {
-      entity.setProvisionAction(request.getProvisionAction());
-    }
-
     // host groups
     Collection<TopologyHostGroupEntity> hostGroupEntities = new ArrayList<TopologyHostGroupEntity>();
     for (HostGroupInfo groupInfo : request.getHostGroupInfo().values())  {

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
index 417ec54..ab35a48 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
@@ -166,8 +166,6 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
   public static final String AUTHENTICATED_USER_ID_COLUMN = "authenticated_user_id";
   protected static final String CLUSTER_VERSION_TABLE = "cluster_version";
   protected static final String HOST_VERSION_TABLE = "host_version";
-  protected static final String TOPOLOGY_REQUEST_TABLE = "topology_request";
-  protected static final String PROVISION_ACTION_COL = "provision_action";
   protected static final String PHOENIX_QUERY_SERVER_PRINCIPAL_KEY = "phoenix.queryserver.kerberos.principal";
   protected static final String PHOENIX_QUERY_SERVER_KEYTAB_KEY = "phoenix.queryserver.keytab.file";
   protected static final String DEFAULT_CONFIG_VERSION = "version1";
@@ -310,7 +308,6 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
     createRemoteClusterTable();
     updateViewInstanceTable();
     updateRequestScheduleEntityTable();
-    updateTopologyRequestTable();
   }
 
   private void createRemoteClusterTable() throws SQLException {
@@ -1338,12 +1335,6 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
         new DBColumnInfo(PRINCIPAL_ID_COL, Long.class, null, null, true));
   }
 
-  protected void updateTopologyRequestTable() throws SQLException {
-    // Add the sort_order column to the adminpermission table
-    dbAccessor.addColumn(TOPOLOGY_REQUEST_TABLE,
-      new DBColumnInfo(PROVISION_ACTION_COL, String.class, null, 100, true));
-  }
-
   /**
    * Updates the {@value #ALERT_DEFINITION_TABLE} in the following ways:
    * <ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 78cf5a4..b13c121 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -729,7 +729,6 @@ CREATE TABLE topology_request (
   cluster_properties TEXT,
   cluster_attributes TEXT,
   description VARCHAR(1024),
-  provision_action VARCHAR(100),
   CONSTRAINT PK_topology_request PRIMARY KEY (id),
   CONSTRAINT FK_topology_request_cluster_id FOREIGN KEY (cluster_id) REFERENCES clusters(cluster_id));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index a2074e7..fd14e80 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -851,7 +851,6 @@ CREATE TABLE ambari.topology_request (
   cluster_properties TEXT,
   cluster_attributes TEXT,
   description VARCHAR(1024),
-  provision_action VARCHAR(100),
   CONSTRAINT PK_topology_request PRIMARY KEY (id),
   CONSTRAINT FK_topology_request_cluster_id FOREIGN KEY (cluster_id) REFERENCES ambari.clusters(cluster_id)
 );

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index e10955b..0574c2b 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -725,7 +725,6 @@ CREATE TABLE topology_request (
   cluster_properties TEXT,
   cluster_attributes TEXT,
   description VARCHAR(1024),
-  provision_action VARCHAR(100),
   CONSTRAINT PK_topology_request PRIMARY KEY (id),
   CONSTRAINT FK_topology_request_cluster_id FOREIGN KEY (cluster_id) REFERENCES clusters(cluster_id));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index f7b6630..02becf2 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -746,7 +746,6 @@ CREATE TABLE topology_request (
   cluster_properties TEXT,
   cluster_attributes TEXT,
   description VARCHAR(1024),
-  provision_action VARCHAR(100),
   CONSTRAINT PK_topology_request PRIMARY KEY CLUSTERED (id),
   CONSTRAINT FK_topology_request_cluster_id FOREIGN KEY (cluster_id) REFERENCES clusters(cluster_id));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
index c7261ea..7f2ea7c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
@@ -144,7 +144,7 @@ public class ClusterResourceProviderTest {
   public void testCreateResource_blueprint_With_ProvisionAction() throws Exception {
     Set<Map<String, Object>> requestProperties = createBlueprintRequestProperties(CLUSTER_NAME,
BLUEPRINT_NAME);
     Map<String, Object> properties = requestProperties.iterator().next();
-    properties.put(BaseClusterRequest.PROVISION_ACTION_PROPERTY, "INSTALL_ONLY");
+    properties.put(ProvisionClusterRequest.PROVISION_ACTION_PROPERTY, "INSTALL_ONLY");
     Map<String, String> requestInfoProperties = new HashMap<String, String>();
     requestInfoProperties.put(Request.REQUEST_INFO_BODY_PROPERTY, "{}");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
index bb3db03..43645b4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
@@ -42,7 +42,6 @@ import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.HostNotFoundException;
 import org.apache.ambari.server.agent.AgentEnv;
 import org.apache.ambari.server.agent.HostInfo;
-import org.apache.ambari.server.controller.internal.ProvisionClusterRequest;
 import org.apache.ambari.server.events.HostRegisteredEvent;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
@@ -500,7 +499,7 @@ public class ClustersTest {
 
     Map<String, HostGroupInfo> hostGroups = Maps.newHashMap();
 
-    ProvisionClusterRequest topologyRequest = createNiceMock(ProvisionClusterRequest.class);
+    TopologyRequest topologyRequest = createNiceMock(TopologyRequest.class);
     expect(topologyRequest.getType()).andReturn(TopologyRequest.Type.PROVISION).anyTimes();
     expect(topologyRequest.getBlueprint()).andReturn(bp).anyTimes();
     expect(topologyRequest.getClusterId()).andReturn(cluster.getClusterId()).anyTimes();
@@ -654,7 +653,7 @@ public class ClustersTest {
     hostGroupInfo.addHost(hostName + "3");
     hostGroups.put(groupName, hostGroupInfo);
 
-    ProvisionClusterRequest topologyRequest = createNiceMock(ProvisionClusterRequest.class);
+    TopologyRequest topologyRequest = createNiceMock(TopologyRequest.class);
     expect(topologyRequest.getType()).andReturn(TopologyRequest.Type.PROVISION).anyTimes();
     expect(topologyRequest.getBlueprint()).andReturn(bp).anyTimes();
     expect(topologyRequest.getClusterId()).andReturn(cluster.getClusterId()).anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/818de68a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index 8ddbaca..b753662 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -320,16 +320,13 @@ public class UpgradeCatalog240Test {
     expect(dbAccessor.getConnection()).andReturn(connection);
     expect(connection.createStatement()).andReturn(statement);
 
-    dbAccessor.dropColumn(UpgradeCatalog240.VIEWINSTANCE_TABLE, UpgradeCatalog240.CLUSTER_HANDLE_COLUMN);
+    dbAccessor.dropColumn(UpgradeCatalog240.VIEWINSTANCE_TABLE,UpgradeCatalog240.CLUSTER_HANDLE_COLUMN);
 
     Capture<DBAccessor.DBColumnInfo> capturedClusterHandleColumn = EasyMock.newCapture();
-    dbAccessor.renameColumn(eq(UpgradeCatalog240.VIEWINSTANCE_TABLE), anyString(), capture(capturedClusterHandleColumn));
+    dbAccessor.renameColumn(eq(UpgradeCatalog240.VIEWINSTANCE_TABLE), anyString() , capture(capturedClusterHandleColumn));
     Capture<DBAccessor.DBColumnInfo> requestScheduleUserIdInfo = newCapture();
     dbAccessor.addColumn(eq(UpgradeCatalog240.REQUESTSCHEDULE_TABLE), capture(requestScheduleUserIdInfo));
 
-    Capture<DBAccessor.DBColumnInfo> provisionActionColumnInfo = newCapture();
-    dbAccessor.addColumn(eq(UpgradeCatalog240.TOPOLOGY_REQUEST_TABLE), capture(provisionActionColumnInfo));
-
     replay(dbAccessor, configuration, connection, statement, resultSet);
 
     Module module = new Module() {
@@ -540,12 +537,6 @@ public class UpgradeCatalog240Test {
     Assert.assertEquals(Integer.class, requestScheduleUserIdInfoValue.getType());
     Assert.assertEquals(null, requestScheduleUserIdInfoValue.getDefaultValue());
 
-    DBAccessor.DBColumnInfo provisionActionColumnInfoValue = provisionActionColumnInfo.getValue();
-    Assert.assertNotNull(provisionActionColumnInfoValue);
-    Assert.assertEquals(UpgradeCatalog240.PROVISION_ACTION_COL, provisionActionColumnInfoValue.getName());
-    Assert.assertEquals(String.class, provisionActionColumnInfoValue.getType());
-    Assert.assertEquals(true, provisionActionColumnInfoValue.isNullable());
-
     verify(dbAccessor);
   }
 


Mime
View raw message