sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1024: GenericJdbcConnectorUpgrader must ignore inputs which may not exist in old version
Date Thu, 02 May 2013 00:10:35 GMT
Updated Branches:
  refs/heads/sqoop2 4f318755d -> 810724860


SQOOP-1024: GenericJdbcConnectorUpgrader must ignore inputs which may not exist in old version

(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/81072486
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/81072486
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/81072486

Branch: refs/heads/sqoop2
Commit: 810724860869d46d7d21b1116cea2ba993d6c37e
Parents: 4f31875
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed May 1 17:09:57 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed May 1 17:09:57 2013 -0700

----------------------------------------------------------------------
 .../jdbc/GenericJdbcConnectorMetadataUpgrader.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/81072486/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorMetadataUpgrader.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorMetadataUpgrader.java
b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorMetadataUpgrader.java
index cd461f4..864426c 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorMetadataUpgrader.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorMetadataUpgrader.java
@@ -18,6 +18,8 @@
  */
 package org.apache.sqoop.connector.jdbc;
 
+import org.apache.log4j.Logger;
+import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.spi.MetadataUpgrader;
 import org.apache.sqoop.model.MConnectionForms;
 import org.apache.sqoop.model.MForm;
@@ -30,6 +32,9 @@ import java.util.List;
 import java.util.Map;
 
 public class GenericJdbcConnectorMetadataUpgrader extends MetadataUpgrader {
+  private static final Logger LOG =
+    Logger.getLogger(GenericJdbcConnectorMetadataUpgrader.class);
+
   /*
    * For now, there is no real upgrade. So copy all data over,
    * set the validation messages and error messages to be the same as for the
@@ -62,8 +67,13 @@ public class GenericJdbcConnectorMetadataUpgrader extends MetadataUpgrader
{
       List<MInput<?>> inputs = form.getInputs();
       MForm originalForm = formMap.get(form.getName());
       for (MInput input : inputs) {
-        MInput originalInput = originalForm.getInput(input.getName());
-        input.setValue(originalInput.getValue());
+        try {
+          MInput originalInput = originalForm.getInput(input.getName());
+          input.setValue(originalInput.getValue());
+        } catch (SqoopException ex) {
+          LOG.warn("Input: " + input.getName() + " not present in old " +
+            "connector. So it will not be transferred by the upgrader.");
+        }
       }
     }
   }


Mime
View raw message