fuse_dfs_wrapper.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env bash
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements. See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. if [ "$HADOOP_PREFIX" = "" ]; then
  19. echo "HADOOP_PREFIX is empty. Set it to the root directory of Hadoop source code"
  20. exit 1
  21. fi
  22. export FUSEDFS_PATH="$HADOOP_PREFIX/hadoop-hdfs-project/hadoop-hdfs-native-client/target/main/native/fuse-dfs"
  23. export LIBHDFS_PATH="$HADOOP_PREFIX/hadoop-hdfs-project/hadoop-hdfs-native-client/target/usr/local/lib"
  24. if [ "$OS_ARCH" = "" ]; then
  25. export OS_ARCH=amd64
  26. fi
  27. if [ "$JAVA_HOME" = "" ]; then
  28. export JAVA_HOME=/usr/local/java
  29. fi
  30. if [ "$LD_LIBRARY_PATH" = "" ]; then
  31. export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/$OS_ARCH/server:/usr/local/lib
  32. fi
  33. while IFS= read -r -d '' file
  34. do
  35. export CLASSPATH=$CLASSPATH:$file
  36. done < <(find "$HADOOP_PREFIX/hadoop-client" -name "*.jar" -print0)
  37. while IFS= read -r -d '' file
  38. do
  39. export CLASSPATH=$CLASSPATH:$file
  40. done < <(find "$HADOOP_PREFIX/hhadoop-hdfs-project" -name "*.jar" -print0)
  41. export CLASSPATH=$HADOOP_CONF_DIR:$CLASSPATH
  42. export PATH=$FUSEDFS_PATH:$PATH
  43. export LD_LIBRARY_PATH=$LIBHDFS_PATH:$JAVA_HOME/jre/lib/$OS_ARCH/server
  44. fuse_dfs "$@"