Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB86317411 for ; Tue, 5 May 2015 01:17:56 +0000 (UTC) Received: (qmail 18536 invoked by uid 500); 5 May 2015 01:17:56 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 18501 invoked by uid 500); 5 May 2015 01:17:56 -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 18492 invoked by uid 99); 5 May 2015 01:17:56 -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; Tue, 05 May 2015 01:17:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AF67BE0AFE; Tue, 5 May 2015 01:17:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swagle@apache.org To: commits@ambari.apache.org Date: Tue, 05 May 2015 01:17:56 -0000 Message-Id: <5e4ac161978b4303b614c67e792396c6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ambari git commit: AMBARI-10918. Ambari with DB as oracle is failing to deploy. (swagle) Repository: ambari Updated Branches: refs/heads/trunk ce3e14370 -> 5226ae1be AMBARI-10918. Ambari with DB as oracle is failing to deploy. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0c39d4ef Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0c39d4ef Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0c39d4ef Branch: refs/heads/trunk Commit: 0c39d4ef5343c8fb055cd2581538ae26d9a77fba Parents: ce3e143 Author: Siddharth Wagle Authored: Mon May 4 17:52:40 2015 -0700 Committer: Siddharth Wagle Committed: Mon May 4 17:52:40 2015 -0700 ---------------------------------------------------------------------- .../ambari/server/orm/dao/ServiceConfigDAO.java | 7 ++++--- .../ambari/server/orm/entities/WidgetEntity.java | 15 ++++++++++++--- .../ambari/server/upgrade/UpgradeCatalog210.java | 6 +++--- .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 4 ++-- .../src/main/resources/Ambari-DDL-Oracle-CREATE.sql | 4 ++-- .../main/resources/Ambari-DDL-Postgres-CREATE.sql | 4 ++-- .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 4 ++-- 7 files changed, 27 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java index 8f8e196..db0817b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java @@ -18,6 +18,7 @@ package org.apache.ambari.server.orm.dao; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -212,13 +213,13 @@ public class ServiceConfigDAO { */ @RequiresSession public Long findNextServiceConfigVersion(long clusterId, String serviceName) { - TypedQuery query = entityManagerProvider.get().createNamedQuery( - "ServiceConfigEntity.findNextServiceConfigVersion", Long.class); + TypedQuery query = entityManagerProvider.get().createNamedQuery( + "ServiceConfigEntity.findNextServiceConfigVersion", Number.class); query.setParameter("clusterId", clusterId); query.setParameter("serviceName", serviceName); - return daoUtils.selectSingle(query); + return daoUtils.selectSingle(query).longValue(); } @Transactional http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java index 397d845..b65a87b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java @@ -17,13 +17,16 @@ */ package org.apache.ambari.server.orm.entities; +import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; +import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; @@ -67,7 +70,9 @@ public class WidgetEntity { @Column(name = "widget_type", nullable = false, length = 255) private String widgetType; - @Column(name = "metrics", length = 32672) + @Lob + @Basic(fetch = FetchType.LAZY) + @Column(name = "metrics") private String metrics; @Column(name = "time_created", nullable = false, length = 255) @@ -85,10 +90,14 @@ public class WidgetEntity { @Column(name = "scope", length = 255) private String scope; - @Column(name = "widget_values", length = 4000) + @Lob + @Basic(fetch = FetchType.LAZY) + @Column(name = "widget_values") private String widgetValues; - @Column(name = "properties", length = 4000) + @Lob + @Basic(fetch = FetchType.LAZY) + @Column(name = "properties") private String properties; @Column(name = "cluster_id", nullable = false) http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java index dc7f7a9..0845e4b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java @@ -498,14 +498,14 @@ public class UpgradeCatalog210 extends AbstractUpgradeCatalog { columns.add(new DBColumnInfo("id", Long.class, null, null, false)); columns.add(new DBColumnInfo("widget_name", String.class, 255, null, false)); columns.add(new DBColumnInfo("widget_type", String.class, 255, null, false)); - columns.add(new DBColumnInfo("metrics", String.class, 32672, null, true)); + columns.add(new DBColumnInfo("metrics", byte[].class, null, null, true)); columns.add(new DBColumnInfo("time_created", Long.class, null, null, false)); columns.add(new DBColumnInfo("author", String.class, 255, null, true)); columns.add(new DBColumnInfo("description", String.class, 255, null, true)); columns.add(new DBColumnInfo("display_name", String.class, 255, null, true)); columns.add(new DBColumnInfo("scope", String.class, 255, null, true)); - columns.add(new DBColumnInfo("widget_values", String.class, 4000, null, true)); - columns.add(new DBColumnInfo("properties", String.class, 4000, null, true)); + columns.add(new DBColumnInfo("widget_values", byte[].class, null, null, true)); + columns.add(new DBColumnInfo("properties", byte[].class, null, null, true)); columns.add(new DBColumnInfo("cluster_id", Long.class, null, null, false)); dbAccessor.createTable(WIDGET_TABLE, columns, "id"); http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql index 7f00b10..d32f3cd 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql @@ -551,8 +551,8 @@ CREATE TABLE widget ( description VARCHAR(255), display_name VARCHAR(255), scope VARCHAR(255), - widget_values VARCHAR(4000), - properties VARCHAR(4000), + widget_values LONGTEXT, + properties LONGTEXT, cluster_id BIGINT NOT NULL, PRIMARY KEY(id) ); http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql index c0313e5..4317c83 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql @@ -541,8 +541,8 @@ CREATE TABLE widget ( description VARCHAR2(255), display_name VARCHAR2(255), scope VARCHAR2(255), - widget_values VARCHAR2(4000), - properties VARCHAR2(4000), + widget_values CLOB, + properties CLOB, cluster_id NUMBER(19) NOT NULL, PRIMARY KEY(id) ); http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql index 94e4884..e3cef5d 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql @@ -550,8 +550,8 @@ CREATE TABLE widget ( description VARCHAR(255), display_name VARCHAR(255), scope VARCHAR(255), - widget_values VARCHAR(4000), - properties VARCHAR(4000), + widget_values TEXT, + properties TEXT, cluster_id BIGINT NOT NULL, PRIMARY KEY(id) ); http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql index 54c8c40..77186a1 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql @@ -626,8 +626,8 @@ CREATE TABLE ambari.widget ( description VARCHAR(255), display_name VARCHAR(255), scope VARCHAR(255), - widget_values VARCHAR(4000), - properties VARCHAR(4000), + widget_values TEXT, + properties TEXT, cluster_id BIGINT NOT NULL, PRIMARY KEY(id) );