sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1271: Sqoop hcatalog location should support older bigtop default location also
Date Thu, 23 Jan 2014 18:00:10 GMT
Updated Branches:
  refs/heads/trunk 55c5f27f9 -> da5ab302e


SQOOP-1271: Sqoop hcatalog location should support older bigtop default location also

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

Branch: refs/heads/trunk
Commit: da5ab302e974b566eb06c895161fbeb777dbc10a
Parents: 55c5f27
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Thu Jan 23 09:58:47 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Thu Jan 23 09:59:08 2014 -0800

----------------------------------------------------------------------
 bin/configure-sqoop                         |  5 +++++
 src/java/org/apache/sqoop/SqoopOptions.java | 28 ++++++++++++++----------
 2 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/da5ab302/bin/configure-sqoop
----------------------------------------------------------------------
diff --git a/bin/configure-sqoop b/bin/configure-sqoop
index 4dd2690..6b19c6c 100755
--- a/bin/configure-sqoop
+++ b/bin/configure-sqoop
@@ -82,8 +82,13 @@ fi
 if [ -z "${HCAT_HOME}" ]; then
   if [ -d "/usr/lib/hive-hcatalog" ]; then
     HCAT_HOME=/usr/lib/hive-hcatalog
+  elif [ -d "/usr/lib/hcatalog" ]; then
+    HCAT_HOME=/usr/lib/hcatalog
   else
     HCAT_HOME=${SQOOP_HOME}/../hive-hcatalog
+    if [ ! -d ${HCAT_HOME} ]; then
+       HCAT_HOME=${SQOOP_HOME}/../hcatalog
+    fi
   fi
 fi
 if [ -z "${ACCUMULO_HOME}" ]; then

http://git-wip-us.apache.org/repos/asf/sqoop/blob/da5ab302/src/java/org/apache/sqoop/SqoopOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/SqoopOptions.java b/src/java/org/apache/sqoop/SqoopOptions.java
index 19546cb..46e158c 100644
--- a/src/java/org/apache/sqoop/SqoopOptions.java
+++ b/src/java/org/apache/sqoop/SqoopOptions.java
@@ -18,9 +18,6 @@
 
 package org.apache.sqoop;
 
-import com.cloudera.sqoop.SqoopOptions.FileLayout;
-import com.cloudera.sqoop.SqoopOptions.IncrementalMode;
-import com.cloudera.sqoop.SqoopOptions.UpdateMode;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Field;
@@ -33,12 +30,6 @@ import java.util.Properties;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-
-import com.cloudera.sqoop.lib.DelimiterSet;
-import com.cloudera.sqoop.lib.LargeObjectLoader;
-import com.cloudera.sqoop.tool.SqoopTool;
-import com.cloudera.sqoop.util.RandomHash;
-import com.cloudera.sqoop.util.StoredAsProperty;
 import org.apache.sqoop.accumulo.AccumuloConstants;
 import org.apache.sqoop.util.CredentialsUtil;
 import org.apache.sqoop.util.LoggingUtils;
@@ -46,6 +37,15 @@ import org.apache.sqoop.validation.AbortOnFailureHandler;
 import org.apache.sqoop.validation.AbsoluteValidationThreshold;
 import org.apache.sqoop.validation.RowCountValidator;
 
+import com.cloudera.sqoop.SqoopOptions.FileLayout;
+import com.cloudera.sqoop.SqoopOptions.IncrementalMode;
+import com.cloudera.sqoop.SqoopOptions.UpdateMode;
+import com.cloudera.sqoop.lib.DelimiterSet;
+import com.cloudera.sqoop.lib.LargeObjectLoader;
+import com.cloudera.sqoop.tool.SqoopTool;
+import com.cloudera.sqoop.util.RandomHash;
+import com.cloudera.sqoop.util.StoredAsProperty;
+
 /**
  * Configurable state used by Sqoop tools.
  */
@@ -62,7 +62,8 @@ public class SqoopOptions implements Cloneable {
 
   // Default hive and hcat locations.
   public static final String DEF_HIVE_HOME = "/usr/lib/hive";
-  public static final String DEF_HCAT_HOME = "/usr/lib/hcatalog";
+  public static final String DEF_HCAT_HOME = "/usr/lib/hive-hcatalog";
+  public static final String DEF_HCAT_HOME_OLD = "/usr/lib/hcatalog";
 
   public static final boolean METASTORE_PASSWORD_DEFAULT = false;
 
@@ -877,7 +878,12 @@ public class SqoopOptions implements Cloneable {
     String hcatHome = System.getenv("HCAT_HOME");
     hcatHome = System.getProperty("hcat.home", hcatHome);
     if (hcatHome == null) {
-      hcatHome = DEF_HCAT_HOME;
+      File file = new File(DEF_HCAT_HOME);
+      if (file.exists()) {
+        hcatHome = DEF_HCAT_HOME;
+      } else {
+        hcatHome = DEF_HCAT_HOME_OLD;
+      }
     }
     return hcatHome;
   }


Mime
View raw message