sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-1754: Sqoop2: Remove JarUtil class
Date Wed, 19 Nov 2014 17:13:39 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 272fc2f8a -> abd12fa54


SQOOP-1754: Sqoop2: Remove JarUtil class

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

Branch: refs/heads/sqoop2
Commit: abd12fa544bda54a22450741717d8c01d202c977
Parents: 272fc2f
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed Nov 19 09:13:05 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed Nov 19 09:13:05 2014 -0800

----------------------------------------------------------------------
 .../sqoop/connector/kite/KiteToInitializer.java | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/abd12fa5/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
index 5d3a0a6..40b3abf 100644
--- a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
+++ b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
@@ -19,15 +19,16 @@ package org.apache.sqoop.connector.kite;
 
 import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.connector.common.JarUtil;
+import org.apache.sqoop.connector.common.FileFormat;
 import org.apache.sqoop.connector.kite.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.kite.configuration.ToJobConfiguration;
 import org.apache.sqoop.job.etl.Initializer;
 import org.apache.sqoop.job.etl.InitializerContext;
+import org.apache.sqoop.schema.NullSchema;
 import org.apache.sqoop.schema.Schema;
+import org.apache.sqoop.utils.ClassUtils;
 
 import java.util.List;
-import java.util.regex.Pattern;
 
 /**
  * This class allows connector to define initialization work for execution.
@@ -39,13 +40,6 @@ public class KiteToInitializer extends Initializer<LinkConfiguration,
 
   private static final Logger LOG = Logger.getLogger(KiteToInitializer.class);
 
-  // Minimal dependencies for the MR job
-  private static final Pattern[] JAR_NAME_PATTERNS = {
-      Pattern.compile("/kite-"),
-      Pattern.compile("/jackson-(annotations|core|databind)-\\d+"),
-      Pattern.compile("/opencsv-"),
-  };
-
   @Override
   public void initialize(InitializerContext context,
       LinkConfiguration linkConfig, ToJobConfiguration jobConfig) {
@@ -59,15 +53,19 @@ public class KiteToInitializer extends Initializer<LinkConfiguration,
   public List<String> getJars(InitializerContext context,
       LinkConfiguration linkConfig, ToJobConfiguration jobConfig) {
     List<String> jars = super.getJars(context, linkConfig, jobConfig);
-    jars.addAll(JarUtil.getMatchedJars(JAR_NAME_PATTERNS));
+    jars.add(ClassUtils.jarForClass("org.kitesdk.data.Formats"));
+    jars.add(ClassUtils.jarForClass("com.fasterxml.jackson.databind.JsonNode"));
+    jars.add(ClassUtils.jarForClass("com.fasterxml.jackson.core.TreeNode"));
+    if (FileFormat.CSV.equals(linkConfig.linkConfig.fileFormat)) {
+      jars.add(ClassUtils.jarForClass("au.com.bytecode.opencsv.CSVWriter"));
+    }
     return jars;
   }
 
   @Override
   public Schema getSchema(InitializerContext context,
       LinkConfiguration linkConfig, ToJobConfiguration jobConfig) {
-    // TO-direction does not have a schema, so return a dummy schema.
-    return new Schema("Kite dataset");
+    return NullSchema.getInstance();
   }
 
 }
\ No newline at end of file


Mime
View raw message