ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-22267 - Version registration failure during patch upgrade + Debian + Oracle run (jonathanhurley)
Date Wed, 18 Oct 2017 21:36:20 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 52e4d7c96 -> e898087fb


AMBARI-22267 - Version registration failure during patch upgrade + Debian + Oracle run (jonathanhurley)


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

Branch: refs/heads/branch-2.6
Commit: e898087fbc4c4515d0f393f9de3e735902876823
Parents: 52e4d7c
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Wed Oct 18 16:46:05 2017 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Wed Oct 18 17:20:39 2017 -0400

----------------------------------------------------------------------
 .../ambari/server/orm/entities/RepositoryVersionEntity.java    | 5 +----
 .../ambari/server/orm/entities/ServiceDesiredStateEntity.java  | 6 +++---
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e898087f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
index edfe494..5936783 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
@@ -21,13 +21,11 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
-import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
@@ -94,7 +92,7 @@ import com.google.inject.Provider;
         query = "SELECT repositoryVersion FROM RepositoryVersionEntity repositoryVersion
WHERE repositoryVersion.version = :version ORDER BY repositoryVersion.id DESC"),
     @NamedQuery(
         name = "findByServiceDesiredVersion",
-        query = "SELECT DISTINCT sd.desiredRepositoryVersion from ServiceDesiredStateEntity
sd WHERE sd.desiredRepositoryVersion IN ?1") })
+        query = "SELECT sd.desiredRepositoryVersion from ServiceDesiredStateEntity sd WHERE
sd.desiredRepositoryVersion IN ?1 GROUP BY sd.desiredRepositoryVersion.id") })
 @StaticallyInject
 public class RepositoryVersionEntity {
   private static Logger LOG = LoggerFactory.getLogger(RepositoryVersionEntity.class);
@@ -131,7 +129,6 @@ public class RepositoryVersionEntity {
   @Enumerated(value = EnumType.STRING)
   private RepositoryType type = RepositoryType.STANDARD;
 
-  @Basic(fetch=FetchType.LAZY)
   @Lob
   @Column(name="version_xml", insertable = true, updatable = true)
   private String versionXml;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e898087f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
index 0124d3e..3ef0768 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
@@ -40,20 +40,20 @@ import org.apache.commons.lang.builder.EqualsBuilder;
 @Entity
 public class ServiceDesiredStateEntity {
 
-  @Column(name = "cluster_id", nullable = false, insertable = false, updatable = false, length
= 10)
   @Id
+  @Column(name = "cluster_id", nullable = false, insertable = false, updatable = false, length
= 10)  
   private Long clusterId;
 
-  @Column(name = "service_name", nullable = false, insertable = false, updatable = false)
   @Id
+  @Column(name = "service_name", nullable = false, insertable = false, updatable = false)
   private String serviceName;
 
   @Column(name = "desired_state", nullable = false, insertable = true, updatable = true)
   @Enumerated(value = EnumType.STRING)
   private State desiredState = State.INIT;
 
-  @Column(name = "desired_host_role_mapping", nullable = false, insertable = true, updatable
= true, length = 10)
   @Basic
+  @Column(name = "desired_host_role_mapping", nullable = false, insertable = true, updatable
= true, length = 10)  
   private int desiredHostRoleMapping = 0;
 
   @Column(name = "maintenance_state", nullable = false, insertable = true, updatable = true)


Mime
View raw message