sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kathl...@apache.org
Subject git commit: SQOOP-1044: Sqoop2: Improve logging in metadata upgrade methods
Date Mon, 13 May 2013 04:32:25 GMT
Updated Branches:
  refs/heads/sqoop2 344fa0163 -> b3ebfdda6


SQOOP-1044: Sqoop2: Improve logging in metadata upgrade methods

(Jarek Jarcec Cecho via Kate Ting)


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

Branch: refs/heads/sqoop2
Commit: b3ebfdda6166d3402bd4a7e45b74b5b8f2a6cddf
Parents: 344fa01
Author: Kate Ting <kathleen@apache.org>
Authored: Mon May 13 00:31:33 2013 -0400
Committer: Kate Ting <kathleen@apache.org>
Committed: Mon May 13 00:31:33 2013 -0400

----------------------------------------------------------------------
 .../org/apache/sqoop/repository/Repository.java    |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/b3ebfdda/core/src/main/java/org/apache/sqoop/repository/Repository.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/repository/Repository.java b/core/src/main/java/org/apache/sqoop/repository/Repository.java
index 3e34ccb..21dd759 100644
--- a/core/src/main/java/org/apache/sqoop/repository/Repository.java
+++ b/core/src/main/java/org/apache/sqoop/repository/Repository.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.repository;
 
+import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.ConnectorManager;
 import org.apache.sqoop.connector.spi.MetadataUpgrader;
@@ -49,6 +50,8 @@ import java.util.List;
  */
 public abstract class Repository {
 
+  private static final Logger LOG = Logger.getLogger(Repository.class);
+
   public abstract RepositoryTransaction getTransaction();
 
   /**
@@ -321,8 +324,8 @@ public abstract class Repository {
    * @param newConnector New properties for the Connector that should be
    *                     upgraded.
    */
-  public final void upgradeConnector(MConnector oldConnector,
-    MConnector newConnector) {
+  public final void upgradeConnector(MConnector oldConnector, MConnector newConnector) {
+    LOG.info("Upgrading metadata for connector: " + oldConnector.getUniqueName());
     long connectorID = oldConnector.getPersistenceId();
     newConnector.setPersistenceId(connectorID);
     /* Algorithms:
@@ -388,10 +391,12 @@ public abstract class Repository {
       if(tx != null) {
         tx.close();
       }
+      LOG.info("Metadata upgrade finished for connector: " + oldConnector.getUniqueName());
     }
   }
 
   public final void upgradeFramework(MFramework framework) {
+    LOG.info("Upgrading framework metadata");
     RepositoryTransaction tx = null;
     try {
       MetadataUpgrader upgrader = FrameworkManager.getInstance()
@@ -441,6 +446,7 @@ public abstract class Repository {
       if(tx != null) {
         tx.close();
       }
+      LOG.info("Framework metadata upgrade finished");
     }
   }
 


Mime
View raw message