flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject flink git commit: [FLINK-1477] Respect HADOOP_HOME when starting Flink
Date Thu, 05 Feb 2015 10:15:21 GMT
Repository: flink
Updated Branches:
  refs/heads/master 48d8dd5a5 -> 5e1cc9e21


[FLINK-1477] Respect HADOOP_HOME when starting Flink


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

Branch: refs/heads/master
Commit: 5e1cc9e21ccd2afb1be0fc97ef13cb5b6da9c9e0
Parents: 48d8dd5
Author: Robert Metzger <rmetzger@apache.org>
Authored: Thu Feb 5 11:03:17 2015 +0100
Committer: Robert Metzger <rmetzger@apache.org>
Committed: Thu Feb 5 11:03:17 2015 +0100

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/config.sh            | 13 +++++++++++++
 .../java/org/apache/flink/yarn/FlinkYarnClient.java    |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/5e1cc9e2/flink-dist/src/main/flink-bin/bin/config.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/config.sh b/flink-dist/src/main/flink-bin/bin/config.sh
index c0a48ba..75757dc 100755
--- a/flink-dist/src/main/flink-bin/bin/config.sh
+++ b/flink-dist/src/main/flink-bin/bin/config.sh
@@ -192,6 +192,19 @@ JVM_ARGS=""
 # Default classpath 
 CLASSPATH=`manglePathList $( echo $FLINK_LIB_DIR/*.jar . | sed 's/ /:/g' )`
 
+# Check if deprecated HADOOP_HOME is set.
+if [ -n "$HADOOP_HOME" ]; then
+    # HADOOP_HOME is set. Check if its a Hadoop 1.x or 2.x HADOOP_HOME path
+    if [ -d "$HADOOP_HOME/conf" ]; then
+        # its a Hadoop 1.x
+        HADOOP_CONF_DIR="$HADOOP_CONF_DIR:$HADOOP_HOME/conf"
+    fi
+    if [ -d "$HADOOP_HOME/etc/hadoop" ]; then
+        # Its Hadoop 2.2+
+        HADOOP_CONF_DIR="$HADOOP_CONF_DIR:$HADOOP_HOME/etc/hadoop"
+    fi
+fi
+
 # Auxilliary function which extracts the name of host from a line which
 # also potentialy includes topology information and the taskManager type
 extractHostName() {

http://git-wip-us.apache.org/repos/asf/flink/blob/5e1cc9e2/flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnClient.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnClient.java b/flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnClient.java
index 6b97393..23ef523 100644
--- a/flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnClient.java
+++ b/flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnClient.java
@@ -269,7 +269,7 @@ public class FlinkYarnClient extends AbstractFlinkYarnClient {
 		}
 
 		// check if required Hadoop environment variables are set. If not, warn user
-		if(System.getenv("HADOOP_CONF_DIR") == null ||
+		if(System.getenv("HADOOP_CONF_DIR") == null &&
 				System.getenv("YARN_CONF_DIR") == null) {
 			LOG.warn("Neither the HADOOP_CONF_DIR nor the YARN_CONF_DIR environment variable is set."
+
 					"The Flink YARN Client needs one of these to be set to properly load the Hadoop " +


Mime
View raw message