@@ -35,7 +35,7 @@ if [[ -z "${DORIS_THIRDPARTY}" ]]; then
3535fi
3636export TP_INCLUDE_DIR=" ${DORIS_THIRDPARTY} /installed/include"
3737export TP_LIB_DIR=" ${DORIS_THIRDPARTY} /installed/lib"
38-
38+ HADOOP_DEPS_NAME= " hadoop-deps "
3939. " ${DORIS_HOME} /env.sh"
4040
4141# Check args
204204 ;;
205205 --cloud)
206206 BUILD_CLOUD=1
207+ BUILD_BE_JAVA_EXTENSIONS=1
207208 shift
208209 ;;
209210 --broker)
@@ -553,6 +554,7 @@ if [[ "${BUILD_BE_JAVA_EXTENSIONS}" -eq 1 ]]; then
553554 # lakesoul-scanner has been deprecated
554555 # modules+=("be-java-extensions/lakesoul-scanner")
555556 modules+=(" be-java-extensions/preload-extensions" )
557+ modules+=(" be-java-extensions/${HADOOP_DEPS_NAME} " )
556558
557559 # If the BE_EXTENSION_IGNORE variable is not empty, remove the modules that need to be ignored from FE_MODULES
558560 if [[ -n " ${BE_EXTENSION_IGNORE} " ]]; then
@@ -811,10 +813,6 @@ if [[ "${OUTPUT_BE_BINARY}" -eq 1 ]]; then
811813 cp -r -p " ${DORIS_HOME} /be/output/conf" /* " ${DORIS_OUTPUT} /be/conf" /
812814 cp -r -p " ${DORIS_HOME} /be/output/dict" " ${DORIS_OUTPUT} /be/"
813815
814- if [[ -d " ${DORIS_THIRDPARTY} /installed/lib/hadoop_hdfs/" ]]; then
815- cp -r -p " ${DORIS_THIRDPARTY} /installed/lib/hadoop_hdfs/" " ${DORIS_OUTPUT} /be/lib/"
816- fi
817-
818816 if [[ -f " ${DORIS_THIRDPARTY} /installed/lib/libz.so" ]]; then
819817 cp -r -p " ${DORIS_THIRDPARTY} /installed/lib/libz.so" * " ${DORIS_OUTPUT} /be/lib/"
820818 fi
884882 # extensions_modules+=("lakesoul-scanner")
885883 extensions_modules+=(" preload-extensions" )
886884 extensions_modules+=(" iceberg-metadata-scanner" )
885+ extensions_modules+=(" ${HADOOP_DEPS_NAME} " )
887886
888887 if [[ -n " ${BE_EXTENSION_IGNORE} " ]]; then
889888 IFS=' ,' read -r -a ignore_modules <<< " ${BE_EXTENSION_IGNORE}"
@@ -913,13 +912,34 @@ EOF
913912 module_jar=" ${DORIS_HOME} /fe/be-java-extensions/${extensions_module} /target/${extensions_module} -jar-with-dependencies.jar"
914913 module_proj_jar=" ${DORIS_HOME} /fe/be-java-extensions/${extensions_module} /target/${extensions_module} -project.jar"
915914 mkdir " ${BE_JAVA_EXTENSIONS_DIR} " /" ${extensions_module} "
916- if [[ -f " ${module_jar} " ]]; then
917- cp " ${module_jar} " " ${BE_JAVA_EXTENSIONS_DIR} " /" ${extensions_module} "
918- fi
919- if [[ -f " ${module_proj_jar} " ]]; then
920- cp " ${module_proj_jar} " " ${BE_JAVA_EXTENSIONS_DIR} " /" ${extensions_module} "
915+ echo " Copy Be Extensions ${extensions_module} jar to ${BE_JAVA_EXTENSIONS_DIR} /${extensions_module} "
916+ if [[ " ${extensions_module} " == " ${HADOOP_DEPS_NAME} " ]]; then
917+
918+ BE_HADOOP_HDFS_DIR=" ${DORIS_OUTPUT} /be/lib/hadoop_hdfs/"
919+ echo " Copy Be Extensions hadoop deps jars to ${BE_HADOOP_HDFS_DIR} "
920+ rm -rf " ${BE_HADOOP_HDFS_DIR} "
921+ mkdir " ${BE_HADOOP_HDFS_DIR} "
922+ HADOOP_DEPS_JAR_DIR=" ${DORIS_HOME} /fe/be-java-extensions/${HADOOP_DEPS_NAME} /target"
923+ echo " HADOOP_DEPS_JAR_DIR: ${HADOOP_DEPS_JAR_DIR} "
924+ if [[ -f " ${HADOOP_DEPS_JAR_DIR} /${HADOOP_DEPS_NAME} .jar" ]]; then
925+ echo " Copy Be Extensions hadoop deps jar to ${BE_HADOOP_HDFS_DIR} "
926+ cp " ${HADOOP_DEPS_JAR_DIR} /${HADOOP_DEPS_NAME} .jar" " ${BE_HADOOP_HDFS_DIR} "
927+ fi
928+ if [[ -d " ${HADOOP_DEPS_JAR_DIR} /lib" ]]; then
929+ cp -r " ${HADOOP_DEPS_JAR_DIR} /lib" " ${BE_HADOOP_HDFS_DIR} /"
930+ fi
931+ else
932+ if [[ -f " ${module_jar} " ]]; then
933+ cp " ${module_jar} " " ${BE_JAVA_EXTENSIONS_DIR} " /" ${extensions_module} "
934+ fi
935+ if [[ -f " ${module_proj_jar} " ]]; then
936+ cp " ${module_proj_jar} " " ${BE_JAVA_EXTENSIONS_DIR} " /" ${extensions_module} "
937+ fi
938+ if [[ -d " ${DORIS_HOME} /fe/be-java-extensions/${extensions_module} /target/lib" ]]; then
939+ cp -r " ${DORIS_HOME} /fe/be-java-extensions/${extensions_module} /target/lib" " ${BE_JAVA_EXTENSIONS_DIR} /${extensions_module} /"
940+ fi
921941 fi
922- done
942+ done
923943
924944 # copy jindofs jars, only support for Linux x64 or arm
925945 install -d " ${DORIS_OUTPUT} /be/lib/java_extensions/jindofs" /
958978if [[ ${BUILD_CLOUD} -eq 1 ]]; then
959979 rm -rf " ${DORIS_HOME} /output/ms"
960980 rm -rf " ${DORIS_HOME} /cloud/output/lib/hadoop_hdfs"
961- if [[ -d " ${DORIS_THIRDPARTY} /installed/lib/hadoop_hdfs/" ]]; then
962- cp -r -p " ${DORIS_THIRDPARTY} /installed/lib/hadoop_hdfs/" " ${DORIS_HOME} /cloud/output/lib"
981+ # If hadoop dependencies are required, building cloud module must be done after building be-java-extensions first
982+ # so when running ./build.sh --cloud,we also build be-java-extensions automatically.
983+ # If hadoop-depencies are not needed, you can disable it explicitly, by setting DISABLE_BE_JAVA_EXTENSIONS during the build.
984+ HADOOP_DEPS_JAR_DIR=" ${DORIS_HOME} /fe/be-java-extensions/${HADOOP_DEPS_NAME} /target"
985+ if [[ -d " ${HADOOP_DEPS_JAR_DIR} /lib" ]]; then
986+ mkdir -p " ${DORIS_HOME} /cloud/output/lib/hadoop_hdfs"
987+ cp -r " ${HADOOP_DEPS_JAR_DIR} /lib/" * " ${DORIS_HOME} /cloud/output/lib/hadoop_hdfs/"
963988 fi
964989 cp -r -p " ${DORIS_HOME} /cloud/output" " ${DORIS_HOME} /output/ms"
965990fi
0 commit comments