ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [2/5] git commit: AMBARI-6894. UpgradeTest broken on trunk.(vbrodetskyi)
Date Mon, 18 Aug 2014 16:39:18 GMT
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 <vbrodetskyi@hortonworks.com>
Authored: Mon Aug 18 18:17:49 2014 +0300
Committer: Jonathan Hurley <jhurley@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


Mime
View raw message