You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/12/03 01:34:28 UTC

ambari git commit: AMBARI-14164. Downgrade could not save cluster state to remove configs (ncole)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 b37ce4121 -> c03c1db67


AMBARI-14164. Downgrade could not save cluster state to remove configs (ncole)


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

Branch: refs/heads/branch-2.1
Commit: c03c1db67adcbde512947e7e03b6eea3dd9f5ccf
Parents: b37ce41
Author: Nate Cole <nc...@hortonworks.com>
Authored: Wed Dec 2 19:34:13 2015 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Wed Dec 2 19:34:13 2015 -0500

----------------------------------------------------------------------
 .../server/orm/entities/ClusterConfigEntity.java  | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c03c1db6/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
index 899ffe8..607d5fa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
@@ -196,16 +196,19 @@ public class ClusterConfigEntity {
 
     ClusterConfigEntity that = (ClusterConfigEntity) o;
 
+    if (configId != null ? !configId.equals(that.configId) : that.configId != null) {
+      return false;
+    }
+
     if (clusterId != null ? !clusterId.equals(that.clusterId) : that.clusterId != null) {
       return false;
     }
 
-    if (configJson != null ? !configJson.equals(that.configJson) : that.configJson != null) {
+    if (type != null ? !type.equals(that.type) : that.type != null) {
       return false;
     }
 
-    if (configAttributesJson != null ? !configAttributesJson
-      .equals(that.configAttributesJson) : that.configAttributesJson != null) {
+    if (tag != null ? !tag.equals(that.tag) : that.tag != null) {
       return false;
     }
 
@@ -214,14 +217,17 @@ public class ClusterConfigEntity {
     }
 
     return true;
+
   }
 
   @Override
   public int hashCode() {
-    int result = clusterId != null ? clusterId.intValue() : 0;
-    result = 31 * result + (configJson != null ? configJson.hashCode() : 0);
-    result = 31 * result + (configAttributesJson != null ? configAttributesJson.hashCode() : 0);
+    int result = configId != null ? configId.intValue() : 0;
+    result = 31 * result + (clusterId != null ? clusterId.intValue() : 0);
+    result = 31 * result + (type != null ? type.hashCode() : 0);
+    result = 31 * result + (tag != null ? tag.hashCode() : 0);
     result = 31 * result + (stack != null ? stack.hashCode() : 0);
+
     return result;
   }