sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1022: Metadata upgrade fails with NPE getConnector method
Date Tue, 30 Apr 2013 22:25:15 GMT
Updated Branches:
  refs/heads/sqoop2 fbd238627 -> 7440af2c5


SQOOP-1022: Metadata upgrade fails with NPE getConnector method

(Hari Shreedharan via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: 7440af2c5875fae7a845c4b1ca1c7f2f78f0b6c0
Parents: fbd2386
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Apr 30 15:21:22 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Apr 30 15:21:22 2013 -0700

----------------------------------------------------------------------
 .../apache/sqoop/connector/ConnectorManager.java   |    4 ++++
 .../org/apache/sqoop/repository/Repository.java    |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/7440af2c/core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java b/core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
index 298e322..27ec754 100644
--- a/core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
+++ b/core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
@@ -129,6 +129,10 @@ public class ConnectorManager {
     return handler.getConnector();
   }
 
+  public SqoopConnector getConnector(String uniqueName) {
+    return handlerMap.get(uniqueName).getConnector();
+  }
+
   public synchronized void initialize() {
     if (LOG.isTraceEnabled()) {
       LOG.trace("Begin connector manager initialization");

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7440af2c/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 57c9be4..c820484 100644
--- a/core/src/main/java/org/apache/sqoop/repository/Repository.java
+++ b/core/src/main/java/org/apache/sqoop/repository/Repository.java
@@ -308,8 +308,9 @@ public abstract class Repository {
      */
     RepositoryTransaction tx = null;
     try {
-      SqoopConnector connector = ConnectorManager.getInstance().getConnector(
-        connectorID);
+      SqoopConnector connector =
+        ConnectorManager.getInstance().getConnector(newConnector
+          .getUniqueName());
       MetadataUpgrader upgrader = connector.getMetadataUpgrader();
       List<MConnection> connections = findConnectionsForConnector(
         connectorID);


Mime
View raw message