incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Adding auto-detect for JAVA_HOME, and removed requirement for HADOOP_HOME to be set.
Date Thu, 28 Mar 2013 01:28:45 GMT
Adding auto-detect for JAVA_HOME, and removed requirement for HADOOP_HOME to be set.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/2876f547
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/2876f547
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/2876f547

Branch: refs/heads/0.1.5
Commit: 2876f54789ded4cd6deea8554939c2307dfa776e
Parents: f4b5ff3
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Mar 27 21:27:22 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Mar 27 21:27:22 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/testsuite/LoadData.java   |    2 +-
 .../main/java/org/apache/blur/FindJavaHome.java    |    8 +++
 .../src/main/scripts/bin/blur-config.sh            |   44 ++-------------
 src/distribution/src/main/scripts/conf/blur-env.sh |    6 +-
 4 files changed, 17 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2876f547/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/LoadData.java
----------------------------------------------------------------------
diff --git a/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/LoadData.java b/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/LoadData.java
index 7b71c88..df0bdb3 100644
--- a/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/LoadData.java
+++ b/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/LoadData.java
@@ -52,7 +52,7 @@ public class LoadData {
     int count = 0;
     int max = 100;
     long start = System.currentTimeMillis();
-    final String table = "test_table";
+    final String table = args[1];
     for (int i = 0; i < numberRows; i++) {
       if (count >= max) {
         double seconds = (System.currentTimeMillis() - start) / 1000.0;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2876f547/src/blur-util/src/main/java/org/apache/blur/FindJavaHome.java
----------------------------------------------------------------------
diff --git a/src/blur-util/src/main/java/org/apache/blur/FindJavaHome.java b/src/blur-util/src/main/java/org/apache/blur/FindJavaHome.java
new file mode 100644
index 0000000..ad14164
--- /dev/null
+++ b/src/blur-util/src/main/java/org/apache/blur/FindJavaHome.java
@@ -0,0 +1,8 @@
+package org.apache.blur;
+
+
+public class FindJavaHome {
+  public static void main(String[] args) {
+    System.out.println(System.getProperty("java.home"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2876f547/src/distribution/src/main/scripts/bin/blur-config.sh
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/bin/blur-config.sh b/src/distribution/src/main/scripts/bin/blur-config.sh
index bd6b016..7c11605 100755
--- a/src/distribution/src/main/scripts/bin/blur-config.sh
+++ b/src/distribution/src/main/scripts/bin/blur-config.sh
@@ -23,6 +23,11 @@ export BLUR_HOME_CONF=$BLUR_HOME/conf
 
 . $BLUR_HOME/conf/blur-env.sh
 if [ -z "$JAVA_HOME" ]; then
+  if which java >/dev/null 2>&1 ; then
+    export JAVA_HOME=`java -cp $bin/../lib/blur-util-*.jar org.apache.blur.FindJavaHome`

+  fi
+fi
+if [ -z "$JAVA_HOME" ]; then
   cat 1>&2 <<EOF
 +======================================================================+
 |      Error: JAVA_HOME is not set and Java could not be found         |
@@ -38,20 +43,6 @@ EOF
   exit 1
 fi
 
-if [ -z "$HADOOP_HOME" ]; then
-  cat 1>&2 <<EOF
-+======================================================================+
-|      Error: HADOOP_HOME is not set                                   |
-+----------------------------------------------------------------------+
-| Please download the stable Hadoop version from Apache web site       |
-|       > http://hadoop.apache.org/ <                                  |
-|                                                                      |
-| Blur requires Hadoop 0.20.205 or later.                              |
-+======================================================================+
-EOF
-  exit 1
-fi
-
 export JAVA=$JAVA_HOME/bin/java
 
 export BLUR_LOGS=${BLUR_LOGS:=$BLUR_HOME/logs}
@@ -66,14 +57,6 @@ fi
 
 BLUR_CLASSPATH=$BLUR_HOME/conf
 
-for f in $HADOOP_HOME/*.jar; do
-  BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
-done
-
-for f in $HADOOP_HOME/lib/*.jar; do
-  BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
-done
-
 for f in $BLUR_HOME/lib/*.jar; do
   BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
 done
@@ -82,23 +65,6 @@ for f in $BLUR_HOME/lib/*.war; do
   BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
 done
 
-for f in $HADOOP_HOME/lib/jsp-2.1/*.jar; do
- BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
-done
-
 export BLUR_CLASSPATH
 
-# setup 'java.library.path' for native-hadoop code if necessary
-if [ -d "${HADOOP_HOME}/build/native" -o -d "${HADOOP_HOME}/lib/native" -o -d "${HADOOP_HOME}/sbin"
]; then
-  JAVA_PLATFORM=`CLASSPATH=${BLUR_CLASSPATH} ${JAVA} -Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS}
org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`
-
-  if [ -d "${HADOOP_HOME}/lib/native" ]; then
-    if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
-      JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:${HADOOP_HOME}/lib/native/${JAVA_PLATFORM}
-    else
-      JAVA_LIBRARY_PATH=${HADOOP_HOME}/lib/native/${JAVA_PLATFORM}
-    fi
-  fi
-fi
-
 HOSTNAME=`hostname`

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2876f547/src/distribution/src/main/scripts/conf/blur-env.sh
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/conf/blur-env.sh b/src/distribution/src/main/scripts/conf/blur-env.sh
index 9c4f20b..4872b15 100755
--- a/src/distribution/src/main/scripts/conf/blur-env.sh
+++ b/src/distribution/src/main/scripts/conf/blur-env.sh
@@ -28,13 +28,13 @@
 #-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:CMSIncrementalDutyCycleMin=10 -XX:CMSIncrementalDutyCycle=50
\
 #-XX:ParallelGCThreads=8 -XX:+UseParNewGC -XX:MaxGCPauseMillis=200 -XX:GCTimeRatio=10 -XX:+DisableExplicitGC
\
 #-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$BLUR_HOME/logs/gc-blur-shard-server_`date
+%Y%m%d_%H%M%S`.log
-export BLUR_SHARD_JVM_OPTIONS="-Xmx1024m"
+export BLUR_SHARD_JVM_OPTIONS="-Xmx1024m -Djava.net.preferIPv4Stack=true"
 
 # JAVA JVM OPTIONS for the shard servers, jvm tuning parameters are placed here.
-export BLUR_CONTROLLER_JVM_OPTIONS="-Xmx1024m"
+export BLUR_CONTROLLER_JVM_OPTIONS="-Xmx1024m -Djava.net.preferIPv4Stack=true"
 
 # JAVA JVM OPTIONS for the shard servers, jvm tuning parameters are placed here.
-export BLUR_COMMAND="-Xmx1024m"
+export BLUR_COMMAND="-Xmx1024m -Djava.net.preferIPv4Stack=true"
 
 # Any SSH Options to be used during startup or shutdown commands.
 export BLUR_SSH_OPTS=


Mime
View raw message