Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CFC88200B79 for ; Wed, 7 Sep 2016 08:36:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CE5E0160AC1; Wed, 7 Sep 2016 06:36:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 21465160AB1 for ; Wed, 7 Sep 2016 08:35:59 +0200 (CEST) Received: (qmail 54861 invoked by uid 500); 7 Sep 2016 06:35:59 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 54850 invoked by uid 99); 7 Sep 2016 06:35:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2016 06:35:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E2D94E2F11; Wed, 7 Sep 2016 06:35:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbhowmick@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: Ambari upgrade to Ambari 2.4.0 failed during DB upgrade due to incorrect TEZ view regex Date: Wed, 7 Sep 2016 06:35:58 +0000 (UTC) archived-at: Wed, 07 Sep 2016 06:36:01 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.5 9ae52cdca -> 1e86d3b76 Ambari upgrade to Ambari 2.4.0 failed during DB upgrade due to incorrect TEZ view regex Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1e86d3b7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1e86d3b7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1e86d3b7 Branch: refs/heads/branch-2.5 Commit: 1e86d3b76fb34a891b84bd73d3d96a2a300675d4 Parents: 9ae52cd Author: Dipayan Bhowmick Authored: Tue Sep 6 16:02:58 2016 +0530 Committer: Dipayan Bhowmick Committed: Wed Sep 7 12:05:08 2016 +0530 ---------------------------------------------------------------------- .../org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java | 4 +++- .../apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1e86d3b7/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java index 57cce3f..8fa720f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java @@ -920,7 +920,9 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog { if (tezSite != null) { String currentTezHistoryUrlBase = tezSite.getProperties().get("tez.tez-ui.history-url.base"); if (!StringUtils.isEmpty(currentTezHistoryUrlBase)) { + LOG.info("Current Tez History URL base: {} ", currentTezHistoryUrlBase); String newTezHistoryUrlBase = getUpdatedTezHistoryUrlBase(currentTezHistoryUrlBase); + LOG.info("New Tez History URL base: {} ", newTezHistoryUrlBase); updateConfigurationProperties("tez-site", Collections.singletonMap("tez.tez-ui.history-url.base", newTezHistoryUrlBase), true, false); } } @@ -937,7 +939,7 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog { * @throws AmbariException if currentTezHistoryUrlBase is malformed or is not compatible with the Tez View url REGEX */ protected String getUpdatedTezHistoryUrlBase(String currentTezHistoryUrlBase) throws AmbariException{ - String pattern = "(.*\\/TEZ\\/)(.*)(\\/TEZ_CLUSTER_INSTANCE)"; + String pattern = "(.*\\/TEZ\\/)(.*)(\\/.*)"; Pattern regex = Pattern.compile(pattern); Matcher matcher = regex.matcher(currentTezHistoryUrlBase); String prefix; http://git-wip-us.apache.org/repos/asf/ambari/blob/1e86d3b7/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java index 161ed13..2a8122f 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java @@ -208,6 +208,9 @@ public class AbstractUpgradeCatalogTest { assertEquals("http://ambari:8080/#/main/views/TEZ/2.2/TEZ_CLUSTER_INSTANCE", upgradeCatalog.getUpdatedTezHistoryUrlBase("http://ambari:8080/#/main/views/TEZ/0.7.0.2.5.0.0-665/TEZ_CLUSTER_INSTANCE")); + assertEquals("http://ambari:8080/#/main/views/TEZ/2.2/tezView", + upgradeCatalog.getUpdatedTezHistoryUrlBase("http://ambari:8080/#/main/views/TEZ/0.7.0.2.5.0.0-665/tezView")); + reset(viewDirectory, archiveUtility); expect(viewDirectory.listFiles(anyObject(FilenameFilter.class))).andReturn(new File[] {viewJarFile}).anyTimes();