ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject ambari git commit: AMBARI-21260. Remove metainfo latest url (dlysnichenko)
Date Fri, 16 Jun 2017 16:20:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fe02e3865 -> eb17e4c69


AMBARI-21260. Remove metainfo latest url (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: eb17e4c6983fab93b5c1db8ff6868286b0f09f31
Parents: fe02e38
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Fri Jun 16 19:19:51 2017 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Fri Jun 16 19:19:51 2017 +0300

----------------------------------------------------------------------
 .../server/api/services/AmbariMetaInfo.java     | 114 ---------
 .../controller/AmbariManagementController.java  |   9 -
 .../AmbariManagementControllerImpl.java         |  38 +--
 .../server/controller/RepositoryResponse.java   |  12 +-
 .../internal/RepositoryResourceProvider.java    |  11 -
 .../RepositoryVersionResourceProvider.java      |  14 --
 .../ambari/server/stack/StackContext.java       |  28 ---
 .../apache/ambari/server/stack/StackModule.java |  32 ---
 .../ambari/server/state/RepositoryInfo.java     |  20 +-
 .../server/state/stack/LatestRepoCallable.java  |  47 ----
 .../server/state/stack/RepositoryXml.java       |   6 -
 .../ambari/server/topology/TopologyManager.java |  40 ----
 .../server/api/services/AmbariMetaInfoTest.java | 238 +------------------
 .../AmbariManagementControllerTest.java         | 202 ----------------
 .../RepositoryResourceProviderTest.java         |   5 +-
 .../ComponentVersionCheckActionTest.java        |   2 +-
 16 files changed, 9 insertions(+), 809 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 8965683..e991b72 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -55,7 +55,6 @@ import org.apache.ambari.server.metadata.AmbariServiceAlertDefinitions;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.MetainfoDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
-import org.apache.ambari.server.orm.entities.MetainfoEntity;
 import org.apache.ambari.server.stack.StackDirectory;
 import org.apache.ambari.server.stack.StackManager;
 import org.apache.ambari.server.stack.StackManagerFactory;
@@ -141,15 +140,6 @@ public class AmbariMetaInfo {
   };
   private final static Logger LOG = LoggerFactory.getLogger(AmbariMetaInfo.class);
 
-  /**
-   * Repository XML base url property name
-   */
-  public static final String REPOSITORY_XML_PROPERTY_BASEURL = "baseurl";
-
-  /**
-   * Repository XML mirrors list property name
-   */
-  public static final String REPOSITORY_XML_PROPERTY_MIRRORSLIST = "mirrorslist";
 
   // all the supported OS'es
   @Inject
@@ -876,110 +866,6 @@ public class AmbariMetaInfo {
     return ALL_SUPPORTED_OS.contains(osType);
   }
 
-  /**
-   * Returns a suitable key for use with stack url overrides.
-   * @param stackName the stack name
-   * @param stackVersion the stack version
-   * @param osType the os
-   * @param repoId the repo id
-   * @param field the field name
-   * @return the key for any repo value override
-   */
-  public static String generateRepoMetaKey(String stackName, String stackVersion,
-      String osType, String repoId, String field) {
-
-    StringBuilder sb = new StringBuilder("repo:/");
-    sb.append(stackName).append('/');
-    sb.append(stackVersion).append('/');
-    sb.append(osType).append('/');
-    sb.append(repoId);
-    sb.append(':').append(field);
-
-    return sb.toString();
-  }
-
-  /**
-   * @param stackName the stack name
-   * @param stackVersion the stack version
-   * @param osType the os
-   * @param repoId the repo id
-   * @param newBaseUrl the new base url
-   * @param newMirrorsList the new mirrors list
-   */
-  public void updateRepo(String stackName,
-                         String stackVersion, String osType, String repoId, String newBaseUrl, String newMirrorsList) throws AmbariException {
-
-    // validate existing
-    RepositoryInfo ri = getRepository(stackName, stackVersion, osType, repoId);
-
-    if (!stackRoot.exists()) {
-      throw new StackAccessException("Stack root does not exist.");
-    }
-
-    if (null != newMirrorsList) {
-      ri.setMirrorsList(newMirrorsList);
-    }
-    if (null != newBaseUrl) {
-      ri.setBaseUrl(newBaseUrl);
-    }
-    if (null != metaInfoDAO) {
-      if (null != newBaseUrl) {
-        updateRepoInMetaInfo(stackName, stackVersion, osType, repoId, newBaseUrl, ri, REPOSITORY_XML_PROPERTY_BASEURL);
-      }
-      if (null != newMirrorsList) {
-        updateRepoInMetaInfo(stackName, stackVersion, osType, repoId, newMirrorsList, ri, REPOSITORY_XML_PROPERTY_MIRRORSLIST);
-      }
-    }
-  }
-
-  /**
-   * Update repo property repositoryXmlProperty in metaInfo with new value
-   *
-   * @param stackName             the stack name
-   * @param stackVersion          the stack version
-   * @param osType                the os
-   * @param repoId                the repo id
-   * @param value                 new value
-   * @param ri                    repositoryInfo
-   * @param repositoryXmlProperty repository.xml property name
-   */
-  private void updateRepoInMetaInfo(String stackName, String stackVersion, String osType, String repoId, String value, RepositoryInfo ri, String repositoryXmlProperty) {
-    String metaKey = generateRepoMetaKey(stackName, stackVersion, osType,
-        repoId, repositoryXmlProperty);
-
-    MetainfoEntity entity = new MetainfoEntity();
-    entity.setMetainfoName(metaKey);
-    entity.setMetainfoValue(value);
-
-    // !!! need a way to remove
-    if (StringUtils.isBlank(value)) { // This block should get removed someday, we aren't supporting this mechanism anymore
-      metaInfoDAO.remove(entity);
-    } else {
-      metaInfoDAO.merge(entity);
-      ri.setRepoSaved(true);
-    }
-  }
-
-  public void createRepo(String stackName, String stackVersion, String osType, String repoId, String baseUrl, String mirrorsList) throws AmbariException {
-    if (!stackRoot.exists()) {
-      throw new StackAccessException("Create repo - Stack root does not exist.");
-    }
-
-    if (null != baseUrl) {
-      createRepoInMetaInfo(stackName, stackVersion, osType, repoId, baseUrl, REPOSITORY_XML_PROPERTY_BASEURL);
-    } else if (null != mirrorsList) {
-      createRepoInMetaInfo(stackName, stackVersion, osType, repoId, mirrorsList, REPOSITORY_XML_PROPERTY_MIRRORSLIST);
-    }
-  }
-
-  private void createRepoInMetaInfo(String stackName, String stackVersion, String osType, String repoId, String value, String repositoryXmlProperty) {
-    String metaKey = generateRepoMetaKey(stackName, stackVersion, osType,
-        repoId, repositoryXmlProperty);
-    MetainfoEntity entity = new MetainfoEntity();
-    entity.setMetainfoName(metaKey);
-    entity.setMetainfoValue(value);
-    metaInfoDAO.create(entity);
-  }
 
   public File getStackRoot() {
     return stackRoot;

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index 807bded..bb1c95e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@ -430,15 +430,6 @@ public interface AmbariManagementController {
   Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests) throws AmbariException;
 
   /**
-   * Updates repositories by stack name, version and operating system.
-   *
-   * @param requests the repositories
-   *
-   * @throws AmbariException
-   */
-  void updateRepositories(Set<RepositoryRequest> requests) throws AmbariException;
-
-  /**
    * Verifies repositories' base urls.
    *
    * @param requests the repositories

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/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 4be9419..ed707e7 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
@@ -4385,7 +4385,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         for (OperatingSystemEntity operatingSystem: repositoryVersion.getOperatingSystems()) {
           if (operatingSystem.getOsType().equals(osType)) {
             for (RepositoryEntity repository: operatingSystem.getRepositories()) {
-              final RepositoryResponse response = new RepositoryResponse(repository.getBaseUrl(), osType, repository.getRepositoryId(), repository.getName(), "", "", "");
+              final RepositoryResponse response = new RepositoryResponse(repository.getBaseUrl(), osType, repository.getRepositoryId(), repository.getName(), "", "");
               if (null != versionDefinitionId) {
                 response.setVersionDefinitionId(versionDefinitionId);
               } else {
@@ -4414,7 +4414,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         for (RepositoryXml.Repo repo : os.getRepos()) {
           RepositoryResponse resp = new RepositoryResponse(repo.getBaseUrl(), os.getFamily(),
               repo.getRepoId(), repo.getRepoName(), repo.getMirrorsList(),
-              repo.getBaseUrl(), repo.getLatestUri());
+              repo.getBaseUrl());
 
           resp.setVersionDefinitionId(versionDefinitionId);
           resp.setStackName(stackId.getStackName());
@@ -4447,40 +4447,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
   }
 
   @Override
-  public void updateRepositories(Set<RepositoryRequest> requests) throws AmbariException {
-    for (RepositoryRequest rr : requests) {
-      if (null == rr.getStackName() || rr.getStackName().isEmpty()) {
-        throw new AmbariException("Stack name must be specified.");
-      }
-
-      if (null == rr.getStackVersion() || rr.getStackVersion().isEmpty()) {
-        throw new AmbariException("Stack version must be specified.");
-      }
-
-      if (null == rr.getOsType() || rr.getOsType().isEmpty()) {
-        throw new AmbariException("OS type must be specified.");
-      }
-
-      if (null == rr.getRepoId() || rr.getRepoId().isEmpty()) {
-        throw new AmbariException("Repo ID must be specified.");
-      }
-
-      if (null == rr.getBaseUrl() && null == rr.getMirrorsList()) {
-        throw new AmbariException("Repo Base Url or Mirrors List must be specified.");
-      }
-
-      if (rr.isVerifyBaseUrl()) {
-        verifyRepository(rr);
-      }
-      if (rr.getRepositoryVersionId() != null) {
-        throw new AmbariException("Can't directly update repositories in repository_version, update the repository_version instead");
-      }
-      ambariMetaInfo.updateRepo(rr.getStackName(), rr.getStackVersion(), rr.getOsType(), rr.getRepoId(), rr.getBaseUrl(), rr.getMirrorsList());
-
-    }
-  }
-
-  @Override
   public void verifyRepositories(Set<RepositoryRequest> requests) throws AmbariException {
     for (RepositoryRequest request: requests) {
       if (request.getBaseUrl() == null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/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 84fe7fb..792a166 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
@@ -28,21 +28,19 @@ public class RepositoryResponse {
   private String repoName;
   private String mirrorsList;
   private String defaultBaseUrl;
-  private String latestBaseUrl;
   private Long repositoryVersionId;
   private String versionDefinitionId;
   private Long clusterVersionId;
   private boolean unique;
 
   public RepositoryResponse(String baseUrl, String osType, String repoId,
-      String repoName, String mirrorsList, String defaultBaseUrl, String latestBaseUrl) {
+                            String repoName, String mirrorsList, String defaultBaseUrl) {
     setBaseUrl(baseUrl);
     setOsType(osType);
     setRepoId(repoId);
     setRepoName(repoName);
     setMirrorsList(mirrorsList);
     setDefaultBaseUrl(defaultBaseUrl);
-    setLatestBaseUrl(latestBaseUrl);
   }
 
   public String getStackName() {
@@ -115,14 +113,6 @@ public class RepositoryResponse {
     this.defaultBaseUrl = url;
   }
 
-  public String getLatestBaseUrl() {
-    return latestBaseUrl;
-  }
-
-  public void setLatestBaseUrl(String url) {
-    latestBaseUrl = url;
-  }
-
   public Long getRepositoryVersionId() {
     return repositoryVersionId;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
index a617729..96b498e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
@@ -56,7 +56,6 @@ public class RepositoryResourceProvider extends AbstractControllerResourceProvid
   public static final String REPOSITORY_MIRRORS_LIST_PROPERTY_ID          = PropertyHelper.getPropertyId("Repositories", "mirrors_list");
   public static final String REPOSITORY_DEFAULT_BASE_URL_PROPERTY_ID      = PropertyHelper.getPropertyId("Repositories", "default_base_url");
   public static final String REPOSITORY_VERIFY_BASE_URL_PROPERTY_ID       = PropertyHelper.getPropertyId("Repositories", "verify_base_url");
-  public static final String REPOSITORY_LATEST_BASE_URL_PROPERTY_ID       = PropertyHelper.getPropertyId("Repositories", "latest_base_url");
   public static final String REPOSITORY_REPOSITORY_VERSION_ID_PROPERTY_ID = PropertyHelper.getPropertyId("Repositories", "repository_version_id");
   public static final String REPOSITORY_VERSION_DEFINITION_ID_PROPERTY_ID = PropertyHelper.getPropertyId("Repositories", "version_definition_id");
   public static final String REPOSITORY_UNIQUE_PROPERTY_ID                = PropertyHelper.getPropertyId("Repositories", "unique");
@@ -83,7 +82,6 @@ public class RepositoryResourceProvider extends AbstractControllerResourceProvid
       add(REPOSITORY_MIRRORS_LIST_PROPERTY_ID);
       add(REPOSITORY_DEFAULT_BASE_URL_PROPERTY_ID);
       add(REPOSITORY_VERIFY_BASE_URL_PROPERTY_ID);
-      add(REPOSITORY_LATEST_BASE_URL_PROPERTY_ID);
       add(REPOSITORY_REPOSITORY_VERSION_ID_PROPERTY_ID);
       add(REPOSITORY_VERSION_DEFINITION_ID_PROPERTY_ID);
       add(REPOSITORY_CLUSTER_STACK_VERSION_PROPERTY_ID);
@@ -122,14 +120,6 @@ public class RepositoryResourceProvider extends AbstractControllerResourceProvid
       }
     }
 
-    modifyResources(new Command<Void>() {
-      @Override
-      public Void invoke() throws AmbariException {
-        getManagementController().updateRepositories(requests);
-        return null;
-      }
-    });
-
     return getRequestStatus(null);
   }
 
@@ -169,7 +159,6 @@ public class RepositoryResourceProvider extends AbstractControllerResourceProvid
         setResourceProperty(resource, REPOSITORY_REPO_ID_PROPERTY_ID, response.getRepoId(), requestedIds);
         setResourceProperty(resource, REPOSITORY_MIRRORS_LIST_PROPERTY_ID, response.getMirrorsList(), requestedIds);
         setResourceProperty(resource, REPOSITORY_DEFAULT_BASE_URL_PROPERTY_ID, response.getDefaultBaseUrl(), requestedIds);
-        setResourceProperty(resource, REPOSITORY_LATEST_BASE_URL_PROPERTY_ID, response.getLatestBaseUrl(), requestedIds);
         setResourceProperty(resource, REPOSITORY_UNIQUE_PROPERTY_ID, response.isUnique(), requestedIds);
         if (null != response.getClusterVersionId()) {
           setResourceProperty(resource, REPOSITORY_CLUSTER_STACK_VERSION_PROPERTY_ID, response.getClusterVersionId(), requestedIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
index e9dbe0b..ec246c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
@@ -348,20 +348,6 @@ public class RepositoryVersionResourceProvider extends AbstractAuthorizedResourc
           validateRepositoryVersion(repositoryVersionDAO, ambariMetaInfo, entity);
 
           repositoryVersionDAO.merge(entity);
-
-          //
-          // Update metaInfo table as well
-          //
-          if (operatingSystemEntities != null) {
-            String entityStackName = entity.getStackName();
-            String entityStackVersion = entity.getStackVersion();
-            for (OperatingSystemEntity osEntity : operatingSystemEntities) {
-              List<RepositoryEntity> repositories = osEntity.getRepositories();
-              for (RepositoryEntity repository : repositories) {
-                ambariMetaInfo.updateRepo(entityStackName, entityStackVersion, osEntity.getOsType(), repository.getRepositoryId(), repository.getBaseUrl(), repository.getMirrorsList());
-              }
-            }
-          }
         }
         return null;
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
index 96dfc13..db9d178 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
@@ -26,10 +26,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 
-import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.metadata.ActionMetadata;
 import org.apache.ambari.server.orm.dao.MetainfoDAO;
-import org.apache.ambari.server.orm.entities.MetainfoEntity;
 import org.apache.ambari.server.state.stack.LatestRepoCallable;
 import org.apache.ambari.server.state.stack.OsFamily;
 
@@ -82,32 +80,6 @@ public class StackContext {
   }
 
   /**
-   * Obtain an updated url for the repo.
-   * This will check the database for a user update of the repo url.
-   *
-   * @param stackName     stack name
-   * @param stackVersion  stack version
-   * @param osType        OS type
-   * @param repoId        repo id
-   *
-   * @return  an update url or null if the url has not been updated
-   */
-  public String getUpdatedRepoUrl(String stackName, String stackVersion, String osType, String repoId) {
-    String key = AmbariMetaInfo.generateRepoMetaKey(stackName, stackVersion,
-        osType, repoId, AmbariMetaInfo.REPOSITORY_XML_PROPERTY_BASEURL);
-    MetainfoEntity entity = metaInfoDAO.findByKey(key);
-    return entity != null ? entity.getMetainfoValue() : null;
-  }
-
-  public String getUpdatedMirrorsList(String stackName, String stackVersion, String osType, String repoId) {
-    String key = AmbariMetaInfo.generateRepoMetaKey(stackName, stackVersion,
-        osType, repoId, AmbariMetaInfo.REPOSITORY_XML_PROPERTY_MIRRORSLIST);
-    MetainfoEntity entity = metaInfoDAO.findByKey(key);
-    return entity != null ? entity.getMetainfoValue() : null;
-  }
-
-
-  /**
    * Register a task to obtain the latest repo url from an external location.
    *
    * @param url    external repo information URL

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index c4fab99..7b2f87721 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -1129,9 +1129,6 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
 
       stackRepos = rxml.getRepositories();
 
-      for (RepositoryInfo ri : stackRepos) {
-        processRepository(ri);
-      }
 
       stackInfo.getRepositories().addAll(stackRepos);
     }
@@ -1236,35 +1233,6 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     return repos;
   }
 
-  /**
-   * Process a repository associated with the stack.
-   *
-   * @param ri The RespositoryInfo to process
-   */
-  private RepositoryInfo processRepository(RepositoryInfo ri) {
-
-    LOG.debug("Checking for override for base_url and mirrors list");
-    String updatedUrl = stackContext.getUpdatedRepoUrl(stackInfo.getName(), stackInfo.getVersion(),
-        ri.getOsType(), ri.getRepoId());
-
-    if (null != updatedUrl) {
-      ri.setBaseUrl(updatedUrl);
-      ri.setRepoSaved(true);
-    }
-
-    String updatedMirrList = stackContext.getUpdatedMirrorsList(stackInfo.getName(), stackInfo.getVersion(),
-        ri.getOsType(), ri.getRepoId());
-
-    if (null != updatedMirrList) {
-      ri.setMirrorsList(updatedMirrList);
-      ri.setRepoSaved(true);
-    }
-
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding repo to stack, repoInfo={}", ri);
-    }
-    return ri;
-  }
 
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java
index 5a6673b..d57b5d6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java
@@ -31,7 +31,6 @@ public class RepositoryInfo {
   private String repoName;
   private String mirrorsList;
   private String defaultBaseUrl;
-  private String latestBaseUrl;
   private boolean repoSaved = false;
   private boolean unique = false;
   private boolean ambariManagedRepositories = true;
@@ -121,20 +120,6 @@ public class RepositoryInfo {
   }
 
   /**
-   * @return the latest determined base url
-   */
-  public String getLatestBaseUrl() {
-    return latestBaseUrl;
-  }
-
-  /**
-   * @param url the latest determined base url
-   */
-  public void setLatestBaseUrl(String url) {
-    latestBaseUrl = url;
-  }
-
-  /**
    * @return if the base url or mirrors list was from a saved value
    */
   public boolean isRepoSaved() {
@@ -188,19 +173,18 @@ public class RepositoryInfo {
         Objects.equal(repoName, that.repoName) &&
         Objects.equal(mirrorsList, that.mirrorsList) &&
         Objects.equal(defaultBaseUrl, that.defaultBaseUrl) &&
-        Objects.equal(latestBaseUrl, that.latestBaseUrl) &&
         Objects.equal(ambariManagedRepositories, that.ambariManagedRepositories);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(baseUrl, osType, repoId, repoName, mirrorsList, defaultBaseUrl, latestBaseUrl, repoSaved, unique, ambariManagedRepositories);
+    return Objects.hashCode(baseUrl, osType, repoId, repoName, mirrorsList, defaultBaseUrl, repoSaved, unique, ambariManagedRepositories);
   }
 
   public RepositoryResponse convertToResponse()
   {
     return new RepositoryResponse(getBaseUrl(), getOsType(), getRepoId(),
-        getRepoName(), getMirrorsList(), getDefaultBaseUrl(), getLatestBaseUrl());
+        getRepoName(), getMirrorsList(), getDefaultBaseUrl());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
index a1587b9..0472bc1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
@@ -101,53 +101,6 @@ public class LatestRepoCallable implements Callable<Void> {
       throw e;
     }
 
-    // !!! process latest overrides
-    if (null != latestUrlMap) {
-      for (RepositoryInfo ri : stack.getRepositories()) {
-        if (latestUrlMap.containsKey(ri.getRepoId())) {
-
-          Map<String, Object> valueMap = latestUrlMap.get(ri.getRepoId());
-
-          if (valueMap.containsKey("latest")) {
-
-            @SuppressWarnings("unchecked")
-            Map<String, String> osMap = (Map<String, String>) valueMap.get("latest");
-
-            String baseUrl = resolveOsUrl(ri.getOsType(), osMap);
-            if (null != baseUrl) {
-              // !!! in the case where <name>.repo is defined with the base url, strip that off.
-              // Agents do the reverse action (take the base url, and append <name>.repo)
-
-              String repo_file_format;
-
-              if(os_family.isUbuntuFamily(ri.getOsType())) {
-                repo_file_format = "list";
-              } else {
-                repo_file_format = "repo";
-              }
-
-              String repoFileName = stack.getName().toLowerCase() + "." + repo_file_format;
-              int idx = baseUrl.toLowerCase().indexOf(repoFileName);
-
-              if (-1 != idx && baseUrl.toLowerCase().endsWith(repoFileName)) {
-                baseUrl = baseUrl.substring(0, idx);
-              }
-
-              if ('/' == baseUrl.charAt(baseUrl.length()-1)) {
-                baseUrl = baseUrl.substring(0, baseUrl.length()-1);
-              }
-
-              ri.setLatestBaseUrl(baseUrl);
-              if (ri.getBaseUrl() != null && !ri.isRepoSaved()) {
-                // Override baseUrl with the latestBaseUrl.
-                ri.setBaseUrl(baseUrl);
-              }
-            }
-          }
-        }
-      }
-    }
-
     StackId stackId = new StackId(stack);
     if (!latestUrlMap.containsKey(stackId.toString())) {
       return null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
index 51d386b..03b3705 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
@@ -146,7 +146,6 @@ public class RepositoryXml implements Validable{
     private String mirrorslist = null;
     private String repoid = null;
     private String reponame = null;
-    private String latest = null;
     private boolean unique = false;
 
     private Repo() {
@@ -180,10 +179,6 @@ public class RepositoryXml implements Validable{
       return reponame;
     }
 
-    public String getLatestUri() {
-      return latest;
-    }
-
     /**
      * @return true if version of HDP that change with each release
      */
@@ -217,7 +212,6 @@ public class RepositoryXml implements Validable{
           ri.setOsType(os.trim());
           ri.setRepoId(r.getRepoId());
           ri.setRepoName(r.getRepoName());
-          ri.setLatestBaseUrl(r.getBaseUrl());
           ri.setUnique(r.isUnique());
 
           repos.add(ri);

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
index c153381..73fe33b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
@@ -36,7 +36,6 @@ import java.util.concurrent.Executors;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
-import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorBlueprintProcessor;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariServer;
@@ -294,10 +293,6 @@ public class TopologyManager {
 
     topologyValidatorService.validateTopologyConfiguration(topology);
 
-    if (repoVersion == null){
-      //Override repos stored in the metainfo table with ones included in the blueprint
-      updateRepos(topology.getBlueprint().getRepositorySettings(), stack);
-    }
 
     // create resources
     ambariContext.createAmbariResources(topology, clusterName, securityType, repoVersion);
@@ -353,41 +348,6 @@ public class TopologyManager {
     return getRequestStatus(logicalRequest.getRequestId());
   }
 
-  void updateRepos(List<RepositorySetting> repoSettings, Stack stack) {
-    AmbariMetaInfo ambariMetaInfo = injector.getInstance(AmbariMetaInfo.class);
-    boolean repoExists = false;
-    String stackName = stack.getName();
-    String stackVersion = stack.getVersion();
-    for (RepositorySetting repoSetting: repoSettings){
-      String repoSettingDetails = repoSetting.toString();
-      LOG.info(String.format("New repository setting: %s ", repoSettingDetails));
-      String operatingSystem = repoSetting.getOperatingSystem();
-      String repoId = repoSetting.getRepoId();
-      try {
-        ambariMetaInfo.getRepository(stackName, stackVersion, operatingSystem, repoId);
-        repoExists = true;
-      } catch (AmbariException e){
-        repoExists = false;
-      }
-      LOG.info(String.format("Repo exists: %s ", repoExists));
-      String overrideStrategy = repoSetting.getOverrideStrategy();
-      if (repoExists){
-        if (RepositorySetting.OVERRIDE_STRATEGY_ALWAYS_APPLY.equals(overrideStrategy)){
-          try {
-            ambariMetaInfo.updateRepo(stackName, stackVersion, operatingSystem, repoId, repoSetting.getBaseUrl(), null);
-          } catch (AmbariException e) {
-            LOG.error(String.format("Failed to update repo with information %s", repoSettingDetails), e);
-          }
-        }
-      } else {
-        try {
-          ambariMetaInfo.createRepo(stackName, stackVersion, operatingSystem, repoId, repoSetting.getBaseUrl(), null);
-        } catch (AmbariException e) {
-          LOG.error(String.format("Failed to insert repo with information %s", repoSettingDetails), e);
-        }
-      }
-    }
-  }
 
   /**
    * Saves the quick links profile to the DB as an Ambari setting. Creates a new setting entity or updates the existing

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index 349cb54..e9a6ff7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -246,8 +246,7 @@ public class AmbariMetaInfoTest {
     assertNotNull(redhat6Repo);
     for (RepositoryInfo ri : redhat6Repo) {
       if (STACK_NAME_HDP.equals(ri.getRepoName())) {
-        assertFalse(ri.getBaseUrl().equals(ri.getDefaultBaseUrl()));
-        assertEquals(ri.getBaseUrl(), ri.getLatestBaseUrl());
+        assertTrue(ri.getBaseUrl().equals(ri.getDefaultBaseUrl()));
       }
     }
   }
@@ -285,225 +284,6 @@ public class AmbariMetaInfoTest {
   }
 
   @Test
-  public void testGetRepositoryUpdatedBaseUrl() throws Exception {
-    // Scenario: user has internet and but calls to set repos via api
-    // use whatever they set
-    String buildDir = tmpFolder.getRoot().getAbsolutePath();
-    TestAmbariMetaInfo ambariMetaInfo = setupTempAmbariMetaInfo(buildDir);
-    // The current stack already has (HDP, 2.1.1, redhat6)
-
-    // Updating the baseUrl
-    String newBaseUrl = "http://myprivate-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0";
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, "2.1.1", "redhat6",
-        HDP_REPO_ID, newBaseUrl, null);
-    RepositoryInfo repoInfo = ambariMetaInfo.getRepository(STACK_NAME_HDP, "2.1.1", "redhat6",
-            HDP_REPO_ID);
-    assertEquals(newBaseUrl, repoInfo.getBaseUrl());
-    String prevBaseUrl = repoInfo.getDefaultBaseUrl();
-
-    // mock expectations
-    MetainfoDAO metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    MetainfoEntity entity = createNiceMock(MetainfoEntity.class);
-    expect(metainfoDAO.findByKey("repo:/HDP/2.1.1/redhat6/HDP-2.1.1:baseurl")).andReturn(entity).atLeastOnce();
-    expect(entity.getMetainfoValue()).andReturn(newBaseUrl).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    ambariMetaInfo.init();
-
-    waitForAllReposToBeResolved(ambariMetaInfo);
-
-    List<RepositoryInfo> redhat6Repo = ambariMetaInfo.getRepositories(
-        STACK_NAME_HDP, "2.1.1", "redhat6");
-
-    assertNotNull(redhat6Repo);
-
-    for (RepositoryInfo ri : redhat6Repo) {
-      if (HDP_REPO_NAME.equals(ri.getRepoName())) {
-        assertEquals(newBaseUrl, ri.getBaseUrl());
-        // defaultBaseUrl and baseUrl should not be same, since it is updated.
-        assertFalse(ri.getBaseUrl().equals(ri.getDefaultBaseUrl()));
-      }
-    }
-
-    Capture<MetainfoEntity> c = EasyMock.newCapture();
-
-    metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    reset(entity);
-    expect(metainfoDAO.findByKey("repo:/HDP/2.1.1/redhat6/HDP-2.1.1:baseurl")).andReturn(entity).atLeastOnce();
-    expect(metainfoDAO.merge(EasyMock.capture(c))).andReturn(entity).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    // Reset the database with the original baseUrl
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, "2.1.1", "redhat6",
-        HDP_REPO_ID, prevBaseUrl, null);
-
-    assertEquals(prevBaseUrl, c.getValue().getMetainfoValue());
-    assertTrue(repoInfo.isRepoSaved());
-
-  }
-
-  @Test
-  public void testGetRepositoryUpdatedMirrorList() throws Exception {
-    // Scenario: user has internet and but calls to set repos via api
-    // use whatever they set
-    String buildDir = tmpFolder.getRoot().getAbsolutePath();
-    TestAmbariMetaInfo ambariMetaInfo = setupTempAmbariMetaInfo(buildDir);
-    // The current stack already has (HDP, 2.1.1, redhat6)
-
-    // Updating the mirrors list
-    String newMirrorsList = "http://someMirrorslist";
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, "2.1.1", "redhat6",
-        HDP_REPO_ID, null, newMirrorsList);
-    RepositoryInfo repoInfo = ambariMetaInfo.getRepository(STACK_NAME_HDP, "2.1.1", "redhat6",
-        HDP_REPO_ID);
-    assertEquals(newMirrorsList, repoInfo.getMirrorsList());
-    String testMirrorslist = "http://someTestMirrorslist";
-
-    // mock expectations
-    MetainfoDAO metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    MetainfoEntity entity = createNiceMock(MetainfoEntity.class);
-    expect(metainfoDAO.findByKey("repo:/HDP/2.1.1/redhat6/HDP-2.1.1:mirrorslist")).andReturn(entity).atLeastOnce();
-    expect(entity.getMetainfoValue()).andReturn(newMirrorsList).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    ambariMetaInfo.init();
-
-    waitForAllReposToBeResolved(ambariMetaInfo);
-
-    List<RepositoryInfo> redhat6Repo = ambariMetaInfo.getRepositories(
-        STACK_NAME_HDP, "2.1.1", "redhat6");
-
-    assertNotNull(redhat6Repo);
-
-    for (RepositoryInfo ri : redhat6Repo) {
-      if (HDP_REPO_NAME.equals(ri.getRepoName())) {
-        assertEquals(newMirrorsList, ri.getMirrorsList());
-        // mirrors list should be changed, since it is updated.
-        assertFalse(ri.getMirrorsList().equals(testMirrorslist));
-      }
-    }
-
-    Capture<MetainfoEntity> c = EasyMock.newCapture();
-
-    metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    reset(entity);
-    expect(metainfoDAO.findByKey("repo:/HDP/2.1.1/redhat6/HDP-2.1.1:mirrorslist")).andReturn(entity).atLeastOnce();
-    expect(metainfoDAO.merge(EasyMock.capture(c))).andReturn(entity).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    // Reset the database with the original mirrors list
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, "2.1.1", "redhat6",
-        HDP_REPO_ID, null, testMirrorslist);
-
-    assertEquals(testMirrorslist, c.getValue().getMetainfoValue());
-    assertTrue(repoInfo.isRepoSaved());
-
-  }
-
-  @Test
-  public void testGetRepositoryUpdatedUtilsBaseUrl() throws Exception {
-    // Scenario: user has internet and but calls to set repos via api
-    // use whatever they set
-    String stackVersion = "0.2";
-    String buildDir = tmpFolder.getRoot().getAbsolutePath();
-    TestAmbariMetaInfo ambariMetaInfo = setupTempAmbariMetaInfo(buildDir);
-
-    // Updating the baseUrl
-    String newBaseUrl = "http://myprivate-repo-1.hortonworks.com/HDP-Utils/centos6/2.x/updates/2.0.6.0";
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, stackVersion, "redhat6",
-        REPO_ID, newBaseUrl, null);
-    RepositoryInfo repoInfo = ambariMetaInfo.getRepository(STACK_NAME_HDP, stackVersion, "redhat6",
-            REPO_ID);
-    assertEquals(newBaseUrl, repoInfo.getBaseUrl());
-    String prevBaseUrl = repoInfo.getDefaultBaseUrl();
-
-    // mock expectations
-    MetainfoDAO metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    MetainfoEntity entity = createNiceMock(MetainfoEntity.class);
-    expect(metainfoDAO.findByKey("repo:/HDP/0.2/redhat6/HDP-UTILS-1.1.0.15:baseurl")).andReturn(entity).atLeastOnce();
-    expect(entity.getMetainfoValue()).andReturn(newBaseUrl).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    ambariMetaInfo.init();
-
-    List<RepositoryInfo> redhat6Repo = ambariMetaInfo.getRepositories(
-            STACK_NAME_HDP, stackVersion, "redhat6");
-    assertNotNull(redhat6Repo);
-    for (RepositoryInfo ri : redhat6Repo) {
-      if (HDP_UTILS_REPO_NAME.equals(ri.getRepoName())) {
-        assertEquals(newBaseUrl, ri.getBaseUrl());
-        // defaultBaseUrl and baseUrl should not be same, since it is updated.
-        assertFalse(ri.getBaseUrl().equals(ri.getDefaultBaseUrl()));
-      }
-    }
-
-    // Reset the database with the original baseUrl
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, stackVersion, "redhat6",
-        REPO_ID, prevBaseUrl, null);
-  }
-
-  @Test
-  public void testGetRepositoryNoInternetUpdatedBaseUrl() throws Exception {
-    // Scenario: user has no internet and but calls to set repos via api
-    // use whatever they set
-    String newBaseUrl = "http://myprivate-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0";
-    String buildDir = tmpFolder.getRoot().getAbsolutePath();
-    TestAmbariMetaInfo ambariMetaInfo = setupTempAmbariMetaInfo(buildDir);
-    // The current stack already has (HDP, 2.1.1, redhat6).
-
-    // Deleting the json file referenced by the latestBaseUrl to simulate No
-    // Internet.
-    File latestUrlFile = new File(buildDir, "ambari-metaInfo/HDP/2.1.1/repos/hdp.json");
-    if (System.getProperty("os.name").contains("Windows")) {
-      latestUrlFile.deleteOnExit();
-    }
-    else {
-      FileUtils.deleteQuietly(latestUrlFile);
-      assertTrue(!latestUrlFile.exists());
-    }
-
-    // Update baseUrl
-    ambariMetaInfo.updateRepo("HDP", "2.1.1", "redhat6", "HDP-2.1.1",
-        newBaseUrl, null);
-    RepositoryInfo repoInfo = ambariMetaInfo.getRepository(STACK_NAME_HDP, "2.1.1", "redhat6",
-        STACK_NAME_HDP + "-2.1.1");
-    assertEquals(newBaseUrl, repoInfo.getBaseUrl());
-    String prevBaseUrl = repoInfo.getDefaultBaseUrl();
-
-    // mock expectations
-    MetainfoDAO metainfoDAO = ambariMetaInfo.metaInfoDAO;
-    reset(metainfoDAO);
-    MetainfoEntity entity = createNiceMock(MetainfoEntity.class);
-    expect(metainfoDAO.findByKey("repo:/HDP/2.1.1/redhat6/HDP-2.1.1:baseurl")).andReturn(entity).atLeastOnce();
-    expect(entity.getMetainfoValue()).andReturn(newBaseUrl).atLeastOnce();
-    replay(metainfoDAO, entity);
-
-    ambariMetaInfo.init();
-
-    waitForAllReposToBeResolved(ambariMetaInfo);
-
-    List<RepositoryInfo> redhat6Repo = ambariMetaInfo.getRepositories(
-        STACK_NAME_HDP, "2.1.1", "redhat6");
-    assertNotNull(redhat6Repo);
-    for (RepositoryInfo ri : redhat6Repo) {
-      if (STACK_NAME_HDP.equals(ri.getRepoName())) {
-        // baseUrl should point to the updated baseUrl
-        assertEquals(newBaseUrl, ri.getBaseUrl());
-        assertFalse(ri.getDefaultBaseUrl().equals(ri.getBaseUrl()));
-      }
-    }
-
-    // Reset the database with the original baseUrl
-    ambariMetaInfo.updateRepo(STACK_NAME_HDP, "2.1.1", "redhat6",
-        STACK_NAME_HDP + "-2.1.1", prevBaseUrl, null);
-  }
-
-  @Test
   public void isSupportedStack() throws AmbariException {
     boolean supportedStack = metaInfo.isSupportedStack(STACK_NAME_HDP,
         STACK_VERSION_HDP);
@@ -1735,26 +1515,10 @@ public class AmbariMetaInfoTest {
 
     for (RepositoryInfo ri : metaInfo.getRepositories("HDP", "2.1.1", "centos6")) {
       Assert.assertEquals(
-          "Expected the base url to be set properly",
-          "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.1.1.0-118",
-          ri.getLatestBaseUrl());
-      Assert.assertEquals(
           "Expected the default URL to be the same as in the xml file",
           "http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0",
           ri.getDefaultBaseUrl());
     }
-
-    for (RepositoryInfo ri : metaInfo.getRepositories("HDP", "2.1.1", "suse11")) {
-      Assert.assertEquals(
-          "Expected hdp.json to be stripped from the url",
-          "http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11/2.x/BUILDS/2.1.1.0-118",
-          ri.getLatestBaseUrl());
-    }
-
-    for (RepositoryInfo ri : metaInfo.getRepositories("HDP", "2.1.1", "sles11")) {
-      Assert.assertEquals("http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11/2.x/BUILDS/2.1.1.0-118",
-          ri.getLatestBaseUrl());
-    }
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 3215e72..d76fa9b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -36,7 +36,6 @@ import static org.junit.Assert.fail;
 
 import java.io.StringReader;
 import java.lang.reflect.Type;
-import java.net.UnknownHostException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -7929,207 +7928,6 @@ public class AmbariManagementControllerTest {
   }
 
   @Test
-  public void testUpdateRepoUrl() throws Exception {
-    String INCORRECT_URL_2 = "http://bar.com/foo";
-
-    RepositoryInfo repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertNotNull(repo);
-    assertNotNull(repo.getBaseUrl());
-
-    String original = repo.getBaseUrl();
-
-    repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertEquals(original, repo.getBaseUrl());
-
-    ambariMetaInfo.updateRepo(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID, INCORRECT_BASE_URL, null);
-
-    repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertEquals(INCORRECT_BASE_URL, repo.getBaseUrl());
-    assertEquals(original, repo.getDefaultBaseUrl());
-
-    ambariMetaInfo.updateRepo(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID, INCORRECT_URL_2, null);
-    repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertFalse(INCORRECT_BASE_URL.equals(repo.getBaseUrl()));
-    assertEquals(INCORRECT_URL_2, repo.getBaseUrl());
-    assertEquals(original, repo.getDefaultBaseUrl());
-
-    // verify change with new meta info
-    Configuration configuration = injector.getInstance(Configuration.class);
-    Properties properties = configuration.getProperties();
-    properties.setProperty(Configuration.METADATA_DIR_PATH.getKey(), "src/test/resources/stacks");
-    properties.setProperty(Configuration.SERVER_VERSION_FILE.getKey(), "src/test/resources/version");
-    Configuration newConfiguration = new Configuration(properties);
-
-    AmbariMetaInfo ami = new AmbariMetaInfo(newConfiguration);
-
-    injector.injectMembers(ami);
-    ami.init();
-
-    repo = ami.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertEquals(INCORRECT_URL_2, repo.getBaseUrl());
-    assertNotNull(repo.getDefaultBaseUrl());
-    assertEquals(original, repo.getDefaultBaseUrl());
-
-    ami.updateRepo(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID, original, null);
-    repo = ami.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    assertEquals(original, repo.getBaseUrl());
-    assertEquals(original, repo.getDefaultBaseUrl());
-  }
-
-  @Test
-  public void testUpdateRepoUrlController() throws Exception {
-    String badUrl = "http://some_custom.url";
-    RepositoryInfo repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    RepositoryRequest request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    request.setBaseUrl(badUrl);
-
-    Set<RepositoryRequest> requests = new HashSet<>();
-    requests.add(request);
-
-    // test bad url
-    try {
-      controller.updateRepositories(requests);
-      Assert.fail("Expected a bad URL to throw an exception");
-    } catch (Exception e) {
-      assertNotNull(e);
-      Assert.assertTrue(e.getMessage().contains(badUrl));
-    }
-    // test bad url, but allow to set anyway
-    request.setVerifyBaseUrl(false);
-    controller.updateRepositories(requests);
-    Assert.assertEquals(request.getBaseUrl(), repo.getBaseUrl());
-
-    requests.clear();
-    request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    request.setBaseUrl("https://some_custom.url");
-    request.setVerifyBaseUrl(false);
-    requests.add(request);
-    HostnameVerifier defaultHostnameVerifier = HttpsURLConnection.getDefaultHostnameVerifier();
-    HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
-      @Override
-      public boolean verify(String hostName, SSLSession session) {
-        return true;
-      }
-    });
-    // test https url
-    try {
-      controller.updateRepositories(requests);
-    } catch(Exception e) {
-      // verification passed, but unable to connect to https://some_custom.url
-      assertTrue(e.getCause() instanceof UnknownHostException);
-    }
-    HttpsURLConnection.setDefaultHostnameVerifier(defaultHostnameVerifier);
-
-    requests.clear();
-    request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    request.setBaseUrl("pro://hortonworks.com");
-    requests.add(request);
-    // test bad url
-    try {
-      controller.updateRepositories(requests);
-    } catch (Exception e) {
-      assertTrue(e.getMessage().contains("Could not access base url"));
-    }
-
-    requests.clear();
-    request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    request.setBaseUrl("http://rrr1.cccc");
-    requests.add(request);
-    // test bad url
-    try {
-      controller.updateRepositories(requests);
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-    }
-
-    // reset repo
-    requests.clear();
-    request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID);
-    request.setBaseUrl(repo.getDefaultBaseUrl());
-    requests.add(request);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(repo.getBaseUrl(), repo.getDefaultBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-    String baseUrl = repo.getDefaultBaseUrl();
-    if (!baseUrl.endsWith("/")) {
-      baseUrl += "/";
-    }
-
-    // variation #1: url with trailing slash, suffix preceding slash
-    backingProperties.setProperty(Configuration.REPO_SUFFIX_KEY_UBUNTU.getKey(), "/repodata/repomd.xml");
-    Assert.assertTrue(baseUrl.endsWith("/") && configuration.getRepoValidationSuffixes("ubuntu12")[0].startsWith("/"));
-    request.setBaseUrl(baseUrl);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(baseUrl, repo.getBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-    // variation #2: url with trailing slash, suffix no preceding slash
-    backingProperties.setProperty(Configuration.REPO_SUFFIX_KEY_DEFAULT.getKey(), "repodata/repomd.xml");
-    Assert.assertTrue(baseUrl.endsWith("/") && !configuration.getRepoValidationSuffixes("redhat6")[0].startsWith("/"));
-    request.setBaseUrl(baseUrl);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(baseUrl, repo.getBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-    baseUrl = baseUrl.substring(0, baseUrl.length()-1);
-    // variation #3: url with no trailing slash, suffix no prededing slash
-    Assert.assertTrue(!baseUrl.endsWith("/") && !configuration.getRepoValidationSuffixes("redhat6")[0].startsWith("/"));
-    request.setBaseUrl(baseUrl);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(baseUrl, repo.getBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-    // variation #4: url with no trailing slash, suffix preceding slash
-    backingProperties.setProperty(Configuration.REPO_SUFFIX_KEY_DEFAULT.getKey(), "/repodata/repomd.xml");
-    Assert.assertTrue(!baseUrl.endsWith("/") && configuration.getRepoValidationSuffixes("suse11")[0].startsWith("/"));
-    request.setBaseUrl(baseUrl);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(baseUrl, repo.getBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-    // variation #5: multiple suffix tests
-    backingProperties.setProperty(Configuration.REPO_SUFFIX_KEY_UBUNTU.getKey(), "/foo/bar.xml,/repodata/repomd.xml");
-    Assert.assertTrue(configuration.getRepoValidationSuffixes("ubuntu12").length > 1);
-    request.setBaseUrl(baseUrl);
-    try {
-      controller.updateRepositories(requests);
-      Assert.assertEquals(baseUrl, repo.getBaseUrl());
-    } catch (Exception e) {
-      String exceptionMsg = e.getMessage();
-      assertTrue(exceptionMsg.contains("Could not access base url"));
-      LOG.error("Can not complete test. " + exceptionMsg);
-    }
-
-  }
-
-  @Test
   public void testDeleteHostComponentInVariousStates() throws Exception {
     String cluster1 = getUniqueName();
     createCluster(cluster1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryResourceProviderTest.java
index 59a74d3..409eaad 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryResourceProviderTest.java
@@ -55,7 +55,7 @@ public class RepositoryResourceProviderTest {
     AmbariManagementController managementController = EasyMock.createMock(AmbariManagementController.class);
 
     RepositoryResponse rr = new RepositoryResponse(VAL_BASE_URL, VAL_OS,
-        VAL_REPO_ID, VAL_REPO_NAME, null, null, null);
+        VAL_REPO_ID, VAL_REPO_NAME, null, null);
     rr.setStackName(VAL_STACK_NAME);
     rr.setStackVersion(VAL_STACK_VERSION);
     Set<RepositoryResponse> allResponse = new HashSet<>();
@@ -153,13 +153,12 @@ public class RepositoryResourceProviderTest {
     AmbariManagementController managementController = EasyMock.createMock(AmbariManagementController.class);
 
     RepositoryResponse rr = new RepositoryResponse(VAL_BASE_URL, VAL_OS,
-        VAL_REPO_ID, VAL_REPO_NAME, null, null ,null);
+        VAL_REPO_ID, VAL_REPO_NAME, null, null);
     Set<RepositoryResponse> allResponse = new HashSet<>();
     allResponse.add(rr);
 
     // set expectations
     expect(managementController.getRepositories(EasyMock.<Set<RepositoryRequest>>anyObject())).andReturn(allResponse).times(1);
-    managementController.updateRepositories(EasyMock.<Set<RepositoryRequest>>anyObject());
 
     // replay
     replay(managementController);

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb17e4c6/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
index d39dd48..d07ac15 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
@@ -91,7 +91,7 @@ public class ComponentVersionCheckActionTest {
   private static final StackId HDP_21_STACK = new StackId("HDP-2.1.1");
   private static final StackId HDP_22_STACK = new StackId("HDP-2.2.0");
 
-  private static final String HDP_211_CENTOS6_REPO_URL = "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.1.1.0-118";
+  private static final String HDP_211_CENTOS6_REPO_URL = "http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0";
 
   private Injector m_injector;
 


Mime
View raw message