You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/18 18:39:17 UTC
[1/5] git commit: AMBARI-6895 Log in with different users cause wrong
list of available views.(Buzhor Denys via atkach)
Repository: ambari
Updated Branches:
refs/heads/branch-alerts-dev 9e529eddc -> d17baa9ff
AMBARI-6895 Log in with different users cause wrong list of available views.(Buzhor Denys via atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d17baa9f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d17baa9f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d17baa9f
Branch: refs/heads/branch-alerts-dev
Commit: d17baa9ff380bb12fdf7604f3cec95e0550b0e54
Parents: 006c097
Author: atkach <at...@hortonworks.com>
Authored: Mon Aug 18 19:21:38 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 12:39:08 2014 -0400
----------------------------------------------------------------------
ambari-web/app/controllers/global/cluster_controller.js | 2 ++
ambari-web/app/views/main/menu.js | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d17baa9f/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index ba1006c..d612039 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -364,6 +364,8 @@ App.ClusterController = Em.Controller.extend({
sender: this,
success: 'loadViewInstancesSuccess'
});
+ } else {
+ this.set('ambariViews', []);
}
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/d17baa9f/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index c6e4683..888a806 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -30,7 +30,7 @@ App.MainMenuView = Em.CollectionView.extend({
return App.router.get('clusterController.ambariViews');
}.property('App.router.clusterController.ambariViews'),
- content:function(){
+ content: function(){
var result = [];
if (App.router.get('loggedIn')) {
@@ -62,7 +62,8 @@ App.MainMenuView = Em.CollectionView.extend({
}
return result;
- }.property('App.router.loggedIn', 'App.router.clusterController.isLoaded', 'App.supports.views', 'App.supports.mirroring', 'App.supports.secureCluster', 'App.supports.highAvailability'),
+ }.property('App.router.loggedIn', 'App.router.clusterController.isLoaded', 'App.supports.views', 'App.supports.mirroring',
+ 'App.supports.secureCluster', 'App.supports.highAvailability', 'views.length'),
/**
* Adds observer on lastSetURL and calls navigation sync procedure
[4/5] git commit: AMBARI-6891 Ambari upgrade: Accomodate renaming
pig-content to content in 1.7.0 ugradeCatalog (dsen)
Posted by jo...@apache.org.
AMBARI-6891 Ambari upgrade: Accomodate renaming pig-content to content in 1.7.0 ugradeCatalog (dsen)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/006c0973
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/006c0973
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/006c0973
Branch: refs/heads/branch-alerts-dev
Commit: 006c0973d5cedf7ed1cc14a7d33f9d80710ee39a
Parents: f5a3431
Author: Dmytro Sen <ds...@hortonworks.com>
Authored: Mon Aug 18 19:08:04 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 12:39:08 2014 -0400
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog170.java | 33 ++++++++++++++++++++
.../server/upgrade/UpgradeCatalog170Test.java | 9 +++++-
2 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/006c0973/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 9888177..33a87a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -83,8 +83,11 @@ import com.google.inject.Injector;
*/
public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
private static final String CONTENT_FIELD_NAME = "content";
+ private static final String PIG_CONTENT_FIELD_NAME = "pig-content";
private static final String ENV_CONFIGS_POSTFIX = "-env";
+ private static final String PIG_PROPERTIES_CONFIG_TYPE = "pig-properties";
+
private static final String ALERT_TABLE_DEFINITION = "alert_definition";
private static final String ALERT_TABLE_HISTORY = "alert_history";
private static final String ALERT_TABLE_CURRENT = "alert_current";
@@ -560,6 +563,7 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
moveGlobalsToEnv();
addEnvContentFields();
addMissingConfigs();
+ renamePigProperties();
upgradePermissionModel();
}
@@ -744,6 +748,35 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
false);
}
+ /**
+ * Rename pig-content to content in pig-properties config
+ * @throws AmbariException
+ */
+ protected void renamePigProperties() throws AmbariException {
+ ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
+ AmbariManagementController ambariManagementController = injector.getInstance(
+ AmbariManagementController.class);
+
+ Clusters clusters = ambariManagementController.getClusters();
+ if (clusters == null) {
+ return;
+ }
+
+ Map<String, Cluster> clusterMap = clusters.getClusters();
+
+ if (clusterMap != null && !clusterMap.isEmpty()) {
+ for (final Cluster cluster : clusterMap.values()) {
+ Config oldConfig = cluster.getDesiredConfigByType(PIG_PROPERTIES_CONFIG_TYPE);
+ if (oldConfig != null) {
+ Map<String, String> properties = oldConfig.getProperties();
+ String value = properties.remove(PIG_CONTENT_FIELD_NAME);
+ properties.put(CONTENT_FIELD_NAME, value);
+ configHelper.createConfigType(cluster, ambariManagementController, PIG_PROPERTIES_CONFIG_TYPE, properties, "ambari-upgrade");
+ }
+ }
+ }
+ }
+
protected void addEnvContentFields() throws AmbariException {
ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
AmbariManagementController ambariManagementController = injector.getInstance(
http://git-wip-us.apache.org/repos/asf/ambari/blob/006c0973/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index 9325e9f..4033f03 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -219,6 +219,7 @@ public class UpgradeCatalog170Test {
Cluster cluster = createStrictMock(Cluster.class);
Clusters clusters = createStrictMock(Clusters.class);
Config config = createStrictMock(Config.class);
+ Config pigConfig = createStrictMock(Config.class);
UserDAO userDAO = createNiceMock(UserDAO.class);
PrincipalDAO principalDAO = createNiceMock(PrincipalDAO.class);
@@ -256,6 +257,9 @@ public class UpgradeCatalog170Test {
globalConfigs.put("prop1", "val1");
globalConfigs.put("smokeuser_keytab", "val2");
+ Map<String, String> pigSettings = new HashMap<String, String>();
+ pigSettings.put("pig-content", "foo");
+
Set<String> envDicts = new HashSet<String>();
envDicts.add("hadoop-env");
envDicts.add("global");
@@ -331,8 +335,11 @@ public class UpgradeCatalog170Test {
expect(permissionDAO.findClusterOperatePermission()).andReturn(null);
expect(permissionDAO.findClusterReadPermission()).andReturn(null);
+ expect(cluster.getDesiredConfigByType("pig-properties")).andReturn(pigConfig).anyTimes();
+ expect(pigConfig.getProperties()).andReturn(pigSettings).anyTimes();
+
replay(entityManager, trans, upgradeCatalog, cb, cq, hrc, q);
- replay(dbAccessor, configuration, injector, cluster, clusters, amc, config, configHelper);
+ replay(dbAccessor, configuration, injector, cluster, clusters, amc, config, configHelper, pigConfig);
replay(userDAO, clusterDAO, viewDAO, viewInstanceDAO, permissionDAO);
Class<?> c = AbstractUpgradeCatalog.class;
[5/5] git commit: AMBARI-6893 Fix UI unit tests. (atkach)
Posted by jo...@apache.org.
AMBARI-6893 Fix UI unit tests. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6966fb9a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6966fb9a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6966fb9a
Branch: refs/heads/branch-alerts-dev
Commit: 6966fb9a444dffb5eeda4ba47f6d22a87a169f50
Parents: f9c8bd9
Author: atkach <at...@hortonworks.com>
Authored: Mon Aug 18 18:08:51 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 12:39:08 2014 -0400
----------------------------------------------------------------------
ambari-web/app/utils/config.js | 2 +-
.../main/dashboard/widgets/namenode_cpu.js | 6 ++--
ambari-web/test/utils/config_test.js | 2 +-
.../main/dashboard/widgets/namenode_cpu_test.js | 32 +++++++-------------
4 files changed, 16 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6966fb9a/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index b18bff6..f576f38 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -106,7 +106,7 @@ App.config = Em.Object.create({
* @method getConfigTagFromFileName
**/
getConfigTagFromFileName: function(fileName) {
- return fileName.endsWith('.xml') ? fileName.slice(0,-4) : filename;
+ return fileName.endsWith('.xml') ? fileName.slice(0,-4) : fileName;
},
setPreDefinedServiceConfigs: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/6966fb9a/ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js b/ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js
index 6fca69e..cd3b7f8 100644
--- a/ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js
+++ b/ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js
@@ -78,12 +78,12 @@ App.NameNodeCpuPieChartView = App.PieChartDashboardWidgetView.extend({
},
calcIsPieExists: function() {
- return (this.get('cpuWio') != null);
+ return (!Em.isNone(this.get('cpuWio')));
},
- calcDataForPieChart: function() {
+ calcDataForPieChart: function () {
var value = this.get('cpuWio');
- value = value >= 100 ? 100: value;
+ value = value >= 100 ? 100 : value;
var percent = (value + 0).toFixed(1);
var percent_precise = (value + 0).toFixed(2);
return [ percent, percent_precise];
http://git-wip-us.apache.org/repos/asf/ambari/blob/6966fb9a/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 9a9bd1e..451f748 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -337,7 +337,7 @@ describe('App.config', function () {
App.config.addAdvancedConfigs(this.storedConfigs, modelSetup.setupAdvancedConfigsObject(), 'ZOOKEEPER');
var property = this.storedConfigs.findProperty('name', 'custom.zoo.cfg');
expect(property).to.be.ok;
- expect(property.category).to.eql('Advanced');
+ expect(property.category).to.eql('Advanced zoo.cfg');
});
it('`capacity-scheduler.xml` property with name `content` should have `displayType` `multiLine`', function() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/6966fb9a/ambari-web/test/views/main/dashboard/widgets/namenode_cpu_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/widgets/namenode_cpu_test.js b/ambari-web/test/views/main/dashboard/widgets/namenode_cpu_test.js
index 7d1ffec..347d5d0 100644
--- a/ambari-web/test/views/main/dashboard/widgets/namenode_cpu_test.js
+++ b/ambari-web/test/views/main/dashboard/widgets/namenode_cpu_test.js
@@ -43,21 +43,17 @@ describe('App.NameNodeCpuPieChartView', function() {
describe('#calcIsPieExists', function() {
var tests = [
{
- model: Em.Object.create({
- used: 1
- }),
+ cpuWio: 1,
e: true,
m: 'Exists'
},
{
- model: Em.Object.create({
- used: 0
- }),
- e: true,
- m: 'Exists'
+ cpuWio: null,
+ e: false,
+ m: 'Not exists'
},
{
- model: Em.Object.create({}),
+ cpuWio: undefined,
e: false,
m: 'Not exists'
}
@@ -65,32 +61,26 @@ describe('App.NameNodeCpuPieChartView', function() {
tests.forEach(function(test) {
it(test.m, function() {
- nameNodeCpuPieChartView.set('model', test.model);
+ nameNodeCpuPieChartView.set('cpuWio', test.cpuWio);
expect(nameNodeCpuPieChartView.calcIsPieExists()).to.equal(test.e);
});
});
});
- describe('calcDataForPieChart', function() {
+ describe('calcDataForPieChart', function () {
var tests = [
{
- model: Em.Object.create({
- used: 0
- }),
+ cpuWio: 0,
e: ['0.0', '0.00'],
m: 'Nothing is used'
},
{
- model: Em.Object.create({
- used: 100
- }),
+ cpuWio: 100,
e: ['100.0', '100.00'],
m: 'All is used'
},
{
- model: Em.Object.create({
- used: 50
- }),
+ cpuWio: 50,
e: ['50.0', '50.00'],
m: 'Half is used'
}
@@ -98,7 +88,7 @@ describe('App.NameNodeCpuPieChartView', function() {
tests.forEach(function(test) {
it(test.m, function() {
- nameNodeCpuPieChartView.set('model', test.model);
+ nameNodeCpuPieChartView.set('cpuWio', test.cpuWio);
expect(nameNodeCpuPieChartView.calcDataForPieChart()).to.eql(test.e);
});
});
[3/5] git commit: AMBARI-6889. Add unittests for BEFORE-ANY hook
(aonishuk)
Posted by jo...@apache.org.
AMBARI-6889. Add unittests for BEFORE-ANY hook (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f9c8bd96
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f9c8bd96
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f9c8bd96
Branch: refs/heads/branch-alerts-dev
Commit: f9c8bd96cf60450d349f7c8f2ded20588e86a7a0
Parents: 9e529ed
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Aug 18 16:52:50 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 12:39:08 2014 -0400
----------------------------------------------------------------------
.../1.3.2/hooks/before-ANY/test_before_any.py | 39 ++++++++++++++++++++
.../2.0.6/hooks/before-ANY/test_before_any.py | 39 ++++++++++++++++++++
2 files changed, 78 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f9c8bd96/ambari-server/src/test/python/stacks/1.3.2/hooks/before-ANY/test_before_any.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-ANY/test_before_any.py b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-ANY/test_before_any.py
new file mode 100644
index 0000000..fe623a5
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-ANY/test_before_any.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+from mock.mock import MagicMock, call, patch
+from resource_management import *
+from stacks.utils.RMFTestCase import *
+
+@patch.object(Hook, "run_custom_hook", new = MagicMock())
+class TestHookBeforeInstall(RMFTestCase):
+ def test_hook_default(self):
+ self.executeScript("1.3.2/hooks/before-ANY/scripts/hook.py",
+ classname="BeforeAnyHook",
+ command="hook",
+ config_file="default.json"
+ )
+ self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf -x "" --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip',
+ environment = {'no_proxy': 'c6401.ambari.apache.org'},
+ not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip',
+ ignore_failures = True,
+ path = ['/bin', '/usr/bin/'],
+ )
+ self.assertNoMoreResources()
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f9c8bd96/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
new file mode 100644
index 0000000..3abfa57
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+from mock.mock import MagicMock, call, patch
+from resource_management import *
+from stacks.utils.RMFTestCase import *
+
+@patch.object(Hook, "run_custom_hook", new = MagicMock())
+class TestHookBeforeInstall(RMFTestCase):
+ def test_hook_default(self):
+ self.executeScript("2.0.6/hooks/before-ANY/scripts/hook.py",
+ classname="BeforeAnyHook",
+ command="hook",
+ config_file="default.json"
+ )
+ self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf -x "" --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip',
+ environment = {'no_proxy': 'c6401.ambari.apache.org'},
+ not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip',
+ ignore_failures = True,
+ path = ['/bin', '/usr/bin/'],
+ )
+ self.assertNoMoreResources()
\ No newline at end of file
[2/5] git commit: AMBARI-6894. UpgradeTest broken on
trunk.(vbrodetskyi)
Posted by jo...@apache.org.
AMBARI-6894. UpgradeTest broken on trunk.(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f5a3431d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f5a3431d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f5a3431d
Branch: refs/heads/branch-alerts-dev
Commit: f5a3431d31a5b0cc61cbf7246df44c657960adc9
Parents: 6966fb9
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Aug 18 18:17:49 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 12:39:08 2014 -0400
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog170.java | 101 ++++++++-----------
1 file changed, 44 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f5a3431d/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index fa47428..9888177 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -348,7 +348,50 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
}
dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('service_config_id_seq', 1)", false);
+ + valueColumnName + ") " + "VALUES('alert_definition_id_seq', 0)",
+ false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('alert_group_id_seq', 0)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('alert_target_id_seq', 0)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('alert_history_id_seq', 0)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('alert_notice_id_seq', 0)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('alert_current_id_seq', 0)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('group_id_seq', 1)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('member_id_seq', 1)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('resource_type_id_seq', 4)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('resource_id_seq', 2)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('principal_type_id_seq', 3)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('principal_id_seq', 2)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('permission_id_seq', 5)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('privilege_id_seq', 1)", false);
+
+ dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ + valueColumnName + ") " + "VALUES('service_config_id_seq', 1)", false);
dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
+ valueColumnName + ") " + "VALUES('service_config_application_id_seq', 1)", false);
@@ -457,62 +500,6 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
protected void executeDMLUpdates() throws AmbariException, SQLException {
String dbType = getDbType();
- // add new sequences for view entity
- String valueColumnName = "\"value\"";
- if (Configuration.ORACLE_DB_NAME.equals(dbType)
- || Configuration.MYSQL_DB_NAME.equals(dbType)) {
- valueColumnName = "value";
- }
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_definition_id_seq', 0)",
- false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_group_id_seq', 0)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_target_id_seq', 0)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_history_id_seq', 0)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_notice_id_seq', 0)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('alert_current_id_seq', 0)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('group_id_seq', 1)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('member_id_seq', 1)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('resource_type_id_seq', 4)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('resource_id_seq', 2)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('principal_type_id_seq', 3)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('principal_id_seq', 2)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('permission_id_seq', 5)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('privilege_id_seq', 1)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('service_config_id_seq', 1)", false);
-
- dbAccessor.executeQuery("INSERT INTO ambari_sequences(sequence_name, "
- + valueColumnName + ") " + "VALUES('config_id_seq', 1)", false);
-
// Update historic records with the log paths, but only enough so as to not prolong the upgrade process
executeInTransaction(new Runnable() {
@Override