ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-17733. Tez views disappear and can not be created after upgrade to 2.4.0.0 .(Gaurav Nagar via dipayanb)
Date Fri, 15 Jul 2016 19:53:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 ca1433180 -> 495ad2a1a


AMBARI-17733. Tez views disappear and can not be created after upgrade to 2.4.0.0 .(Gaurav
Nagar via dipayanb)


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

Branch: refs/heads/branch-2.4
Commit: 495ad2a1a77facbe14b588159f8192649284388c
Parents: ca14331
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Sat Jul 16 01:23:07 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Sat Jul 16 01:23:07 2016 +0530

----------------------------------------------------------------------
 .../server/view/ViewDataMigrationContextImpl.java     | 14 ++++++++------
 .../org/apache/ambari/server/view/ViewRegistry.java   |  7 +++++--
 2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/495ad2a1/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
index e1734bd..4502fc8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
@@ -201,12 +201,14 @@ public class ViewDataMigrationContextImpl implements ViewDataMigrationContext
{
     PersistenceConfig persistence = viewDefinition.getConfiguration().getPersistence();
 
     HashMap<String, Class> classes = new HashMap<>();
-    for (EntityConfig c : persistence.getEntities()) {
-      try {
-        Class entity = viewDefinition.getClassLoader().loadClass(c.getClassName());
-        classes.put(c.getClassName(), entity);
-      } catch (ClassNotFoundException e) {
-        e.printStackTrace();
+    if (persistence != null) {
+      for (EntityConfig c : persistence.getEntities()) {
+        try {
+          Class entity = viewDefinition.getClassLoader().loadClass(c.getClassName());
+          classes.put(c.getClassName(), entity);
+        } catch (ClassNotFoundException e) {
+          e.printStackTrace();
+        }
       }
     }
     return classes;

http://git-wip-us.apache.org/repos/asf/ambari/blob/495ad2a1/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index ae04b99..83a3761 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -1676,8 +1676,11 @@ public class ViewRegistry {
         }
         persistView(viewDefinition, instanceDefinitions);
 
-        // add auto instance configurations if required
-        addAutoInstanceDefinition(viewDefinition);
+        // auto instances of loaded old views for doing data migration can not be installed
+        if (getDefinition(viewDefinition.getViewName(), viewDefinition.getVersion()) != null)
{
+          // add auto instance configurations if required
+          addAutoInstanceDefinition(viewDefinition);
+        }
 
         setViewStatus(viewDefinition, ViewEntity.ViewStatus.DEPLOYED, "Deployed " + extractedArchiveDirPath
+ ".");
 


Mime
View raw message