ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adorosz...@apache.org
Subject [13/50] [abbrv] ambari git commit: AMBARI-22325 Fix repository versions (benyoka)
Date Wed, 06 Dec 2017 10:10:11 GMT
AMBARI-22325 Fix repository versions (benyoka)


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

Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: b163e244cd522094ced60f49fe1895eac2994511
Parents: 0c9f28b
Author: Balazs Bence Sari <benyoka@apache.org>
Authored: Thu Nov 16 12:09:19 2017 +0100
Committer: Doroszlai, Attila <adoroszlai@hortonworks.com>
Committed: Tue Dec 5 23:55:56 2017 +0100

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         |  9 ++--
 .../ambari/server/controller/AmbariServer.java  |  8 ++--
 .../server/controller/RepositoryResponse.java   | 10 +++++
 .../server/controller/StackV2Factory.java       | 30 +++++++++----
 .../internal/BlueprintV2ResourceProvider.java   | 10 ++---
 .../ambari/server/orm/entities/StackEntity.java | 11 -----
 .../server/topology/BlueprintV2Factory.java     | 44 +++++++-------------
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |  1 -
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  1 -
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  1 -
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |  1 -
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |  1 -
 .../validators/BlueprintImplV2Test.java         |  4 +-
 13 files changed, 60 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 59e6622..ca68a92 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -4595,11 +4595,8 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
 
     // !!! when asking for Repository responses for a versionDefinition, it is either for
     // an established repo version (a Long) OR from the in-memory generated ones (a String)
-    if (null == repositoryVersionId && null != versionDefinitionId) {
-
-      if (NumberUtils.isDigits(versionDefinitionId)) {
-        repositoryVersionId = Long.valueOf(versionDefinitionId);
-      }
+    if (null == repositoryVersionId && NumberUtils.isDigits(versionDefinitionId))
{
+      repositoryVersionId = Long.valueOf(versionDefinitionId);
     }
 
     Set<RepositoryResponse> responses = new HashSet<>();
@@ -4621,7 +4618,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
               }
               response.setStackName(repositoryVersion.getStackName());
               response.setStackVersion(repositoryVersion.getStackVersion());
-
+              response.setRepoVersion(repositoryVersion.getVersion());
               responses.add(response);
             }
             break;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/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 ed8a17d..5b3d79e 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
@@ -91,6 +91,7 @@ import org.apache.ambari.server.orm.dao.MetainfoDAO;
 import org.apache.ambari.server.orm.dao.PermissionDAO;
 import org.apache.ambari.server.orm.dao.PrincipalDAO;
 import org.apache.ambari.server.orm.dao.PrivilegeDAO;
+import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.orm.dao.ResourceDAO;
 import org.apache.ambari.server.orm.dao.UserDAO;
 import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
@@ -926,16 +927,15 @@ public class AmbariServer {
     BlueprintResourceProvider.init(injector.getInstance(BlueprintFactory.class),
         injector.getInstance(BlueprintDAO.class), injector.getInstance(SecurityConfigurationFactory.class),
         injector.getInstance(Gson.class), ambariMetaInfo);
-    BlueprintV2ResourceProvider.init(injector.getInstance(BlueprintV2Factory.class),
-      injector.getInstance(BlueprintV2DAO.class), injector.getInstance(SecurityConfigurationFactory.class),
-      ambariMetaInfo);
+    BlueprintV2ResourceProvider.init(injector.getInstance(BlueprintV2DAO.class),
+      injector.getInstance(SecurityConfigurationFactory.class), ambariMetaInfo);
     StackDependencyResourceProvider.init(ambariMetaInfo);
     ClusterResourceProvider.init(injector.getInstance(TopologyManager.class),
         injector.getInstance(TopologyRequestFactoryImpl.class), injector.getInstance(SecurityConfigurationFactory
             .class), injector.getInstance(Gson.class));
     HostResourceProvider.setTopologyManager(injector.getInstance(TopologyManager.class));
     BlueprintFactory.init(injector.getInstance(BlueprintDAO.class));
-    BlueprintV2Factory.init(injector.getInstance(BlueprintV2DAO.class));
+    BlueprintV2Factory.init(injector.getInstance(BlueprintV2DAO.class), injector.getInstance(RepositoryVersionDAO.class));
     BaseClusterRequest.init(injector.getInstance(AmbariManagementController.class));
     AmbariContext.init(injector.getInstance(HostRoleCommandFactory.class));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
index 6d0f3fb..1beb1d2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
@@ -30,6 +30,16 @@ public class RepositoryResponse {
   private String osType;
   private String repoId;
   private String repoName;
+  private String repoVersion;
+
+  public String getRepoVersion() {
+    return repoVersion;
+  }
+
+  public void setRepoVersion(String repoVersion) {
+    this.repoVersion = repoVersion;
+  }
+
   private String distribution;
   private String components;
   private String mirrorsList;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
index c7113ae..5d3bcfd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
@@ -30,6 +30,8 @@ import java.util.Set;
 import java.util.stream.Collectors;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
+import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
 import org.apache.ambari.server.orm.entities.StackEntity;
 import org.apache.ambari.server.state.AutoDeployInfo;
 import org.apache.ambari.server.state.ComponentInfo;
@@ -38,25 +40,29 @@ import org.apache.ambari.server.state.StackId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Preconditions;
+
 public class StackV2Factory {
   private final static Logger LOG = LoggerFactory.getLogger(StackV2Factory.class);
 
 
-  private AmbariManagementController controller;
+  private final AmbariManagementController controller;
+  private final RepositoryVersionDAO repositoryVersionDAO;
 
-  public StackV2Factory(AmbariManagementController controller) {
+  public StackV2Factory(AmbariManagementController controller, RepositoryVersionDAO repositoryVersionDAO)
{
     this.controller = controller;
+    this.repositoryVersionDAO = repositoryVersionDAO;
   }
 
-  public StackV2 create(StackEntity stack) throws AmbariException {
-    return create(stack.getStackName(), stack.getStackVersion());
+  public StackV2 create(StackEntity stack, String repositoryVersion) throws AmbariException
{
+    return create(stack.getStackName(), stack.getStackVersion(), repositoryVersion);
   }
 
-  public StackV2 create(StackId id) throws AmbariException {
-    return create(id.getStackName(), id.getStackVersion());
+  public StackV2 create(StackId id, String repositoryVersion) throws AmbariException {
+    return create(id.getStackName(), id.getStackVersion(), repositoryVersion);
   }
 
-  public StackV2 create(String name, String version) throws AmbariException {
+  public StackV2 create(String name, String version, String repositoryVersion) throws AmbariException
{
     Set<StackServiceResponse> stackServices = controller.getStackServices(
       Collections.singleton(new StackServiceRequest(name, version, null)));
 
@@ -74,12 +80,22 @@ public class StackV2Factory {
 
     getComponentInfos(stackData);
 
+    stackData.repoVersion = repositoryVersion;
+    verifyRepositoryVersion(stackData);
+
     return new StackV2(name, version, stackData.repoVersion /* TODO */, stackData.serviceComponents,
stackData.dependencies,
       stackData.dbDependencyInfo, stackData.componentAutoDeployInfo, stackData.serviceConfigurations,
       stackData.requiredServiceConfigurations, stackData.stackConfigurations, stackData.excludedConfigurationTypes,
       stackData.componentInfos);
   }
 
+  private void verifyRepositoryVersion(StackData stackData) throws AmbariException {
+    StackId stackId = new StackId(stackData.stackName, stackData.stackVersion);
+    RepositoryVersionEntity entity =
+      repositoryVersionDAO.findByStackAndVersion(stackId, stackData.repoVersion);
+    Preconditions.checkNotNull(entity, "Repo version %s not found for stack %s", stackData.repoVersion,
stackId);
+  }
+
   private void getComponentInfos(StackData stackData) {
     List<Map.Entry<String, String>> componentServices = stackData.serviceComponents.entrySet().stream().
       flatMap(e -> e.getValue().stream().map( v -> new SimpleImmutableEntry<>(e.getKey(),
v))).

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintV2ResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintV2ResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintV2ResourceProvider.java
index 6d2c4f0..41de5b5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintV2ResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintV2ResourceProvider.java
@@ -113,7 +113,7 @@ public class BlueprintV2ResourceProvider extends AbstractControllerResourceProvi
   /**
    * Used to create Blueprint instances
    */
-  private static BlueprintV2Factory blueprintFactory;
+  private BlueprintV2Factory blueprintFactory;
 
   /**
    * Used to create SecurityConfiguration instances
@@ -135,8 +135,8 @@ public class BlueprintV2ResourceProvider extends AbstractControllerResourceProvi
    * @param controller      management controller
    */
   BlueprintV2ResourceProvider(Set<String> propertyIds,
-                            Map<Resource.Type, String> keyPropertyIds,
-                            AmbariManagementController controller) {
+                              Map<Resource.Type, String> keyPropertyIds,
+                              AmbariManagementController controller) {
 
     super(propertyIds, keyPropertyIds, controller);
     blueprintFactory = BlueprintV2Factory.create(controller);
@@ -145,14 +145,12 @@ public class BlueprintV2ResourceProvider extends AbstractControllerResourceProvi
   /**
    * Static initialization.
    *
-   * @param factory   blueprint factory
    * @param dao       blueprint data access object
    * @param securityFactory
    * @param metaInfo
    */
-  public static void init(BlueprintV2Factory factory, BlueprintV2DAO dao, SecurityConfigurationFactory
+  public static void init(BlueprintV2DAO dao, SecurityConfigurationFactory
     securityFactory, AmbariMetaInfo metaInfo) {
-    blueprintFactory = factory;
     blueprintDAO = dao;
     securityConfigurationFactory = securityFactory;
     ambariMetaInfo = metaInfo;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StackEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StackEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StackEntity.java
index c479cdd..e804797 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StackEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StackEntity.java
@@ -60,9 +60,6 @@ public class StackEntity {
   @Column(name = "stack_version", length = 255, nullable = false)
   private String stackVersion;
 
-  @Column(name = "repo_version", length = 255, nullable = false)
-  private String repoVersion;
-
   @Column(name = "current_mpack_id")
   private Long currentMpackId;
 
@@ -128,14 +125,6 @@ public class StackEntity {
     this.stackVersion = stackVersion;
   }
 
-  public String getRepoVersion() {
-    return repoVersion;
-  }
-
-  public void setRepoVersion(String repoVersion) {
-    this.repoVersion = repoVersion;
-  }
-
   /**
    *
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/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 2c5bc8b..3542ef2 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
@@ -22,18 +22,16 @@ package org.apache.ambari.server.topology;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Optional;
-import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.ObjectNotFoundException;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.StackV2;
 import org.apache.ambari.server.controller.StackV2Factory;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.dao.BlueprintV2DAO;
+import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.orm.entities.BlueprintV2Entity;
-import org.apache.ambari.server.orm.entities.StackEntity;
 import org.apache.ambari.server.stack.NoSuchStackException;
 import org.apache.ambari.server.state.StackId;
 
@@ -75,6 +73,8 @@ public class BlueprintV2Factory {
 
   private boolean prettyPrintJson = false;
   private static BlueprintV2DAO blueprintDAO;
+  private static RepositoryVersionDAO repositoryVersionDAO;
+
   private ConfigurationFactory configFactory = new ConfigurationFactory();
 
   private StackV2Factory stackFactory;
@@ -88,7 +88,7 @@ public class BlueprintV2Factory {
   }
 
   public static BlueprintV2Factory create(AmbariManagementController controller) {
-    return new BlueprintV2Factory(new StackV2Factory(controller));
+    return new BlueprintV2Factory(new StackV2Factory(controller, repositoryVersionDAO));
   }
 
   public static BlueprintV2Factory create(StackV2Factory factory) {
@@ -109,9 +109,10 @@ public class BlueprintV2Factory {
   }
 
   private void updateStacks(BlueprintImplV2 blueprintV2) {
-    Map<StackId, StackV2> stacks = blueprintV2.getStackIds().stream()
-      .map(StackId::new)
-      .collect(Collectors.toMap(Function.identity(), this::parseStack));
+    Map<StackId, StackV2> stacks = blueprintV2.getRepositoryVersions().stream().collect(Collectors.toMap(
+      rv -> new StackId(rv.getStackId()),
+      rv -> parseStack(new StackId(rv.getStackId()), rv.getRepositoryVersion())
+    ));
     blueprintV2.setStacks(stacks);
   }
 
@@ -123,9 +124,9 @@ public class BlueprintV2Factory {
     return createObjectMapper().readValue(entity.getContent(), new TypeReference<Map<String,
Object>>(){});
   }
 
-  private StackV2 parseStack(StackId stackId) {
+  private StackV2 parseStack(StackId stackId, String repositoryVersion) {
     try {
-      return stackFactory.create(stackId);
+      return stackFactory.create(stackId, repositoryVersion);
     } catch (AmbariException e) {
       throw new IllegalArgumentException(
         String.format("Unable to parse stack. name=%s, version=%s", stackId.getStackName(),
stackId.getStackVersion()),
@@ -133,10 +134,6 @@ public class BlueprintV2Factory {
     }
   }
 
-  private StackV2 parseStack(StackEntity stackEntity) {
-    return parseStack(new StackId(stackEntity.getStackName(), stackEntity.getStackVersion()));
-  }
-
   public BlueprintV2Entity convertToEntity(BlueprintV2 blueprint) throws JsonProcessingException
{
     BlueprintV2Entity entity = new BlueprintV2Entity();
     String content = convertToJson(blueprint);
@@ -175,20 +172,6 @@ public class BlueprintV2Factory {
     return blueprint;
   }
 
-  protected StackV2 createStack(Map<String, Object> properties) throws NoSuchStackException
{
-    String stackName = String.valueOf(properties.get(STACK_NAME_PROPERTY_ID));
-    String stackVersion = String.valueOf(properties.get(STACK_VERSION_PROPERTY_ID));
-    try {
-      //todo: don't pass in controller
-      return stackFactory.create(stackName, stackVersion);
-    } catch (ObjectNotFoundException e) {
-      throw new NoSuchStackException(stackName, stackVersion);
-    } catch (AmbariException e) {
-      //todo:
-      throw new RuntimeException("An error occurred parsing the stack information.", e);
-    }
-  }
-
   public boolean isPrettyPrintJson() {
     return prettyPrintJson;
   }
@@ -214,10 +197,11 @@ public class BlueprintV2Factory {
   /**
    * Static initialization.
    *
-   * @param dao  blueprint data access object
+   * @param blueprintV2DAO  blueprint data access object
    */
   @Inject
-  public static void init(BlueprintV2DAO dao) {
-    blueprintDAO = dao;
+  public static void init(BlueprintV2DAO blueprintV2DAO, RepositoryVersionDAO repoVersionDAO)
{
+    blueprintDAO = blueprintV2DAO;
+    repositoryVersionDAO = repoVersionDAO;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index 84349b6..4cef9da 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -39,7 +39,6 @@ CREATE TABLE stack (
   stack_id BIGINT NOT NULL,
   stack_name VARCHAR(255) NOT NULL,
   stack_version VARCHAR(255) NOT NULL,
-  repo_version VARCHAR(255) NOT NULL,
   current_mpack_id BIGINT,
   CONSTRAINT PK_stack PRIMARY KEY (stack_id),
   CONSTRAINT FK_mpacks FOREIGN KEY (current_mpack_id) REFERENCES mpacks(id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index f9d5321..02849d0 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -58,7 +58,6 @@ CREATE TABLE stack (
   stack_id BIGINT NOT NULL,
   stack_name VARCHAR(100) NOT NULL,
   stack_version VARCHAR(100) NOT NULL,
-  repo_version VARCHAR(255) NOT NULL,
   current_mpack_id BIGINT,
   CONSTRAINT PK_stack PRIMARY KEY (stack_id),
   CONSTRAINT FK_mpacks FOREIGN KEY (current_mpack_id) REFERENCES mpacks(id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/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 227645f..d310014 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -39,7 +39,6 @@ CREATE TABLE stack (
   stack_id BIGINT NOT NULL,
   stack_name VARCHAR(255) NOT NULL,
   stack_version VARCHAR(255) NOT NULL,
-  repo_version VARCHAR(255),
   current_mpack_id BIGINT,
   CONSTRAINT PK_stack PRIMARY KEY (stack_id),
   CONSTRAINT FK_mpacks FOREIGN KEY (current_mpack_id) REFERENCES mpacks(id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/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 333a0c3..a510898 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -38,7 +38,6 @@ CREATE TABLE stack (
   stack_id NUMERIC(19) NOT NULL,
   stack_name VARCHAR(255) NOT NULL,
   stack_version VARCHAR(255) NOT NULL,
-  repo_version VARCHAR(255) NOT NULL,
   current_mpack_id BIGINT,
   CONSTRAINT PK_stack PRIMARY KEY (stack_id),
   CONSTRAINT FK_mpacks FOREIGN KEY (current_mpack_id) REFERENCES mpacks(id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/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 120bdb6..1ff1acc 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -51,7 +51,6 @@ CREATE TABLE stack (
   stack_id BIGINT NOT NULL,
   stack_name VARCHAR(255) NOT NULL,
   stack_version VARCHAR(255) NOT NULL,
-  repo_version VARCHAR(255) NOT NULL,
   current_mpack_id BIGINT,
   CONSTRAINT PK_stack PRIMARY KEY CLUSTERED (stack_id),
   CONSTRAINT FK_mpacks FOREIGN KEY (current_mpack_id) REFERENCES mpacks(id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b163e244/ambari-server/src/test/java/org/apache/ambari/server/topology/validators/BlueprintImplV2Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/validators/BlueprintImplV2Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/topology/validators/BlueprintImplV2Test.java
index 41d1ca8..ee2ea1c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/topology/validators/BlueprintImplV2Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/validators/BlueprintImplV2Test.java
@@ -26,8 +26,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
 import org.apache.ambari.server.controller.StackV2;
 import org.apache.ambari.server.controller.StackV2Factory;
 import org.apache.ambari.server.state.StackId;
@@ -39,6 +37,8 @@ import org.junit.Test;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Charsets;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
 import com.google.common.io.Resources;
 
 public class BlueprintImplV2Test {


Mime
View raw message