ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject ambari git commit: AMBARI-10617 - Views : Additional logging for view deployment
Date Tue, 21 Apr 2015 22:39:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c254db4b3 -> 9b2f26698


AMBARI-10617 - Views : Additional logging for view deployment


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

Branch: refs/heads/trunk
Commit: 9b2f26698d964b0cb5eaccc8f394edc87f8d94d0
Parents: c254db4
Author: tbeerbower <tbeerbower@hortonworks.com>
Authored: Tue Apr 21 18:38:37 2015 -0400
Committer: tbeerbower <tbeerbower@hortonworks.com>
Committed: Tue Apr 21 18:38:51 2015 -0400

----------------------------------------------------------------------
 .../org/apache/ambari/server/view/ViewRegistry.java | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b2f2669/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 f6b54ea..7395fa6 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
@@ -1287,16 +1287,23 @@ public class ViewRegistry {
     ViewEntity         persistedView = viewDAO.findByName(viewName);
     ResourceTypeEntity resourceType  = view.getResourceType();
 
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Syncing view " + viewName + ".");
+    }
+
     // if the view is not yet persisted ...
     if (persistedView == null) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Creating View " + viewName + ".");
+        LOG.debug("Creating view " + viewName + ".");
       }
 
       // get or create an admin resource type to represent this view
       ResourceTypeEntity resourceTypeEntity = resourceTypeDAO.findByName(viewName);
       if (resourceTypeEntity == null) {
         resourceTypeEntity = resourceType;
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Creating resource type for " + viewName + ".");
+        }
         resourceTypeDAO.create(resourceTypeEntity);
       }
 
@@ -1333,6 +1340,9 @@ public class ViewRegistry {
         syncViewInstance(instance, persistedInstance);
       }
     }
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Syncing view " + viewName + " complete.");
+    }
   }
 
   // sync the given view instance entity to the matching view instance entity in the registry
@@ -1521,6 +1531,8 @@ public class ViewRegistry {
 
     String extractedArchiveDirPath = extractedArchiveDirFile.getAbsolutePath();
 
+    LOG.info("Reading view archive " + archiveFile + ".");
+
     try {
       // extract the archive and get the class loader
       ClassLoader cl = extractor.extractViewArchive(viewDefinition, archiveFile, extractedArchiveDirFile);
@@ -1543,6 +1555,8 @@ public class ViewRegistry {
         persistView(viewDefinition, instanceDefinitions);
 
         setViewStatus(viewDefinition, ViewEntity.ViewStatus.DEPLOYED, "Deployed " + extractedArchiveDirPath
+ ".");
+
+        LOG.info("View deployed: " + viewDefinition.getName() + ".");
       }
     } catch (Exception e) {
       String msg = "Caught exception loading view " + viewDefinition.getName();


Mime
View raw message