You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/07/23 13:47:58 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #4163: [Spark Load]Create spark load's repository in HDFS for dependencies

morningman commented on a change in pull request #4163:
URL: https://github.com/apache/incubator-doris/pull/4163#discussion_r459445994



##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
##########
@@ -0,0 +1,379 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.load.loadv2;
+
+import org.apache.doris.PaloFe;
+import org.apache.doris.analysis.BrokerDesc;
+import org.apache.doris.common.Config;
+import org.apache.doris.common.FeConstants;
+import org.apache.doris.common.LoadException;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.BrokerUtil;
+import org.apache.doris.thrift.TBrokerFileStatus;
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/*
+ * SparkRepository represents the remote repository for spark archives uploaded by spark
+ * The organization in repository is:
+ *
+ * * __spark_repository__/
+ *   * __archive_1_0_0/
+ *     * __lib_990325d2c0d1d5e45bf675e54e44fb16_spark-dpp.jar
+ *     * __lib_7670c29daf535efe3c9b923f778f61fc_spark-2x.zip
+ *   * __archive_2_2_0/
+ *     * __lib_64d5696f99c379af2bee28c1c84271d5_spark-dpp.jar
+ *     * __lib_1bbb74bb6b264a270bc7fca3e964160f_spark-2x.zip
+ *   * __archive_3_2_0/
+ *     * ...
+ */
+public class SparkRepository {
+    private static final Logger LOG = LogManager.getLogger(SparkRepository.class);
+
+    public static final String REPOSITORY_DIR = "__spark_repository__";
+    public static final String PREFIX_ARCHIVE = "__archive_";
+    public static final String PREFIX_LIB = "__lib_";
+    public static final String SPARK_DPP = "spark-dpp";
+    public static final String SPARK_2X = "spark-2x";
+    public static final String SUFFIX = ".zip";
+
+    private static final String PATH_DELIMITER = "/";
+    private static final String FILE_NAME_SEPARATOR = "_";
+
+    private String remoteRepositoryPath;
+    private BrokerDesc brokerDesc;
+
+    private String localDppPath;
+    private String localSpark2xPath;
+
+    // Version of the spark dpp program in this cluster
+    private String currentDppVersion;
+    // Archive that current dpp version pointed to
+    private SparkArchive currentArchive;
+
+    private ReentrantReadWriteLock rwLock;
+    private boolean isInit;
+
+    public SparkRepository(String remoteRepositoryPath, BrokerDesc brokerDesc) {
+        this.remoteRepositoryPath = remoteRepositoryPath;
+        this.brokerDesc = brokerDesc;
+        this.currentDppVersion = FeConstants.spark_dpp_version;
+        currentArchive = new SparkArchive(getRemoteArchivePath(currentDppVersion), currentDppVersion);
+        this.rwLock = new ReentrantReadWriteLock();
+        this.isInit = false;
+        this.localDppPath = PaloFe.DORIS_HOME_DIR + "/spark-dpp/spark-dpp.jar";

Review comment:
       Make `/spark-dpp/spark-dpp.jar` as a `static final string`

##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java
##########
@@ -39,6 +39,9 @@
     // dpp version
     public static String dpp_version = "3_2_0";
 
+    // spark load version
+    public static String spark_dpp_version = "1_0_0";

Review comment:
       Better to move it to the Config.java

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkEtlJobHandler.java
##########
@@ -92,12 +90,42 @@ public void submitEtlJob(long loadJobId, String loadLabel, EtlJobConfig etlJobCo
         // delete outputPath
         deleteEtlOutputPath(etlJobConfig.outputPath, brokerDesc);
 
-        // upload app resource and jobconfig to hdfs
+        // remote repository
+        SparkRepository.SparkArchive archive = getRemoteArchive(resource.getRepositoryDir(), brokerDesc);
+        List<SparkRepository.SparkLibrary> libraries = archive.libraries;
+        Optional<SparkRepository.SparkLibrary> dppLibrary = libraries.stream().
+                filter(library -> library.libType == SparkRepository.SparkLibrary.LibType.DPP).findFirst();
+        Optional<SparkRepository.SparkLibrary> spark2xLibrary = libraries.stream().
+                filter(library -> library.libType == SparkRepository.SparkLibrary.LibType.SPARK2X).findFirst();
+        if (!dppLibrary.isPresent() || !spark2xLibrary.isPresent()) {
+            throw new LoadException("failed to get library info from repository");
+        }
+
+        // spark home
+        String spark_home = Config.spark_home_default_dir;

Review comment:
       ```suggestion
           String sparkHome = Config.spark_home_default_dir;
   ```

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkEtlJobHandler.java
##########
@@ -92,12 +90,42 @@ public void submitEtlJob(long loadJobId, String loadLabel, EtlJobConfig etlJobCo
         // delete outputPath
         deleteEtlOutputPath(etlJobConfig.outputPath, brokerDesc);
 
-        // upload app resource and jobconfig to hdfs
+        // remote repository
+        SparkRepository.SparkArchive archive = getRemoteArchive(resource.getRepositoryDir(), brokerDesc);
+        List<SparkRepository.SparkLibrary> libraries = archive.libraries;
+        Optional<SparkRepository.SparkLibrary> dppLibrary = libraries.stream().
+                filter(library -> library.libType == SparkRepository.SparkLibrary.LibType.DPP).findFirst();
+        Optional<SparkRepository.SparkLibrary> spark2xLibrary = libraries.stream().
+                filter(library -> library.libType == SparkRepository.SparkLibrary.LibType.SPARK2X).findFirst();
+        if (!dppLibrary.isPresent() || !spark2xLibrary.isPresent()) {
+            throw new LoadException("failed to get library info from repository");
+        }
+
+        // spark home
+        String spark_home = Config.spark_home_default_dir;
+        // etl config path
         String configsHdfsDir = etlJobConfig.outputPath + "/" + JOB_CONFIG_DIR + "/";
-        String appResourceHdfsPath = configsHdfsDir + APP_RESOURCE_NAME;
+        // etl config json path
         String jobConfigHdfsPath = configsHdfsDir + CONFIG_FILE_NAME;
+        // spark submit app resource path
+        String appResourceHdfsPath = dppLibrary.get().remotePath;
+        // spark yarn archive path
+        String jobArchiveHdfsPath = spark2xLibrary.get().remotePath;
+        // spark yarn stage dir
+        String jobStageHdfsPath = resource.getWorkingDir();
+        LOG.info("configsHdfsDir={}, appResourceHdfsPath={}, jobConfigHdfsPath={}, jobArchiveHdfsPath={}",
+                configsHdfsDir, appResourceHdfsPath, jobConfigHdfsPath, jobArchiveHdfsPath);
+
+        // update archive and stage configs here
+        Map<String, String> sparkConfigs = resource.getSparkConfigs();
+        if (Strings.isNullOrEmpty(sparkConfigs.get("spark.yarn.archive"))) {
+            sparkConfigs.put("spark.yarn.archive", jobArchiveHdfsPath);
+        }
+        if (Strings.isNullOrEmpty(sparkConfigs.get("spark.yarn.stage.dir"))) {
+            sparkConfigs.put("spark.yarn.stage.dir", jobStageHdfsPath);

Review comment:
       What' s this `spark.yarn.stage.dir` means?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkEtlJobHandler.java
##########
@@ -114,7 +142,9 @@ public void submitEtlJob(long loadJobId, String loadLabel, EtlJobConfig etlJobCo
                 .setAppResource(appResourceHdfsPath)
                 .setMainClass(SparkEtlJob.class.getCanonicalName())
                 .setAppName(String.format(ETL_JOB_NAME, loadLabel))
+                .setSparkHome(spark_home)

Review comment:
       What is this for?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
##########
@@ -0,0 +1,379 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.load.loadv2;
+
+import org.apache.doris.PaloFe;
+import org.apache.doris.analysis.BrokerDesc;
+import org.apache.doris.common.Config;
+import org.apache.doris.common.FeConstants;
+import org.apache.doris.common.LoadException;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.BrokerUtil;
+import org.apache.doris.thrift.TBrokerFileStatus;
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/*
+ * SparkRepository represents the remote repository for spark archives uploaded by spark
+ * The organization in repository is:
+ *
+ * * __spark_repository__/
+ *   * __archive_1_0_0/
+ *     * __lib_990325d2c0d1d5e45bf675e54e44fb16_spark-dpp.jar
+ *     * __lib_7670c29daf535efe3c9b923f778f61fc_spark-2x.zip
+ *   * __archive_2_2_0/
+ *     * __lib_64d5696f99c379af2bee28c1c84271d5_spark-dpp.jar
+ *     * __lib_1bbb74bb6b264a270bc7fca3e964160f_spark-2x.zip
+ *   * __archive_3_2_0/
+ *     * ...
+ */
+public class SparkRepository {
+    private static final Logger LOG = LogManager.getLogger(SparkRepository.class);
+
+    public static final String REPOSITORY_DIR = "__spark_repository__";
+    public static final String PREFIX_ARCHIVE = "__archive_";
+    public static final String PREFIX_LIB = "__lib_";
+    public static final String SPARK_DPP = "spark-dpp";
+    public static final String SPARK_2X = "spark-2x";
+    public static final String SUFFIX = ".zip";
+
+    private static final String PATH_DELIMITER = "/";
+    private static final String FILE_NAME_SEPARATOR = "_";
+
+    private String remoteRepositoryPath;
+    private BrokerDesc brokerDesc;
+
+    private String localDppPath;
+    private String localSpark2xPath;
+
+    // Version of the spark dpp program in this cluster
+    private String currentDppVersion;
+    // Archive that current dpp version pointed to
+    private SparkArchive currentArchive;
+
+    private ReentrantReadWriteLock rwLock;
+    private boolean isInit;
+
+    public SparkRepository(String remoteRepositoryPath, BrokerDesc brokerDesc) {
+        this.remoteRepositoryPath = remoteRepositoryPath;
+        this.brokerDesc = brokerDesc;
+        this.currentDppVersion = FeConstants.spark_dpp_version;
+        currentArchive = new SparkArchive(getRemoteArchivePath(currentDppVersion), currentDppVersion);
+        this.rwLock = new ReentrantReadWriteLock();
+        this.isInit = false;
+        this.localDppPath = PaloFe.DORIS_HOME_DIR + "/spark-dpp/spark-dpp.jar";
+        if (!Strings.isNullOrEmpty(Config.spark_resource_path)) {
+            this.localSpark2xPath = Config.spark_resource_path;
+        } else {
+            this.localSpark2xPath = Config.spark_home_default_dir + "/jars/spark-2x.zip";
+        }
+    }
+
+    public boolean prepare() throws LoadException {
+        if (!isInit) {
+            initRepository();
+        }
+        return isInit;
+    }
+
+    private void initRepository() throws LoadException {
+        LOG.info("start to init remote repository");

Review comment:
       the whole `initRepository` need to be lock protected

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
##########
@@ -0,0 +1,379 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.load.loadv2;
+
+import org.apache.doris.PaloFe;
+import org.apache.doris.analysis.BrokerDesc;
+import org.apache.doris.common.Config;
+import org.apache.doris.common.FeConstants;
+import org.apache.doris.common.LoadException;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.BrokerUtil;
+import org.apache.doris.thrift.TBrokerFileStatus;
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/*
+ * SparkRepository represents the remote repository for spark archives uploaded by spark
+ * The organization in repository is:
+ *
+ * * __spark_repository__/
+ *   * __archive_1_0_0/
+ *     * __lib_990325d2c0d1d5e45bf675e54e44fb16_spark-dpp.jar
+ *     * __lib_7670c29daf535efe3c9b923f778f61fc_spark-2x.zip
+ *   * __archive_2_2_0/
+ *     * __lib_64d5696f99c379af2bee28c1c84271d5_spark-dpp.jar
+ *     * __lib_1bbb74bb6b264a270bc7fca3e964160f_spark-2x.zip
+ *   * __archive_3_2_0/
+ *     * ...
+ */
+public class SparkRepository {
+    private static final Logger LOG = LogManager.getLogger(SparkRepository.class);
+
+    public static final String REPOSITORY_DIR = "__spark_repository__";
+    public static final String PREFIX_ARCHIVE = "__archive_";
+    public static final String PREFIX_LIB = "__lib_";
+    public static final String SPARK_DPP = "spark-dpp";
+    public static final String SPARK_2X = "spark-2x";
+    public static final String SUFFIX = ".zip";
+
+    private static final String PATH_DELIMITER = "/";
+    private static final String FILE_NAME_SEPARATOR = "_";
+
+    private String remoteRepositoryPath;
+    private BrokerDesc brokerDesc;
+
+    private String localDppPath;
+    private String localSpark2xPath;
+
+    // Version of the spark dpp program in this cluster
+    private String currentDppVersion;
+    // Archive that current dpp version pointed to
+    private SparkArchive currentArchive;
+
+    private ReentrantReadWriteLock rwLock;
+    private boolean isInit;
+
+    public SparkRepository(String remoteRepositoryPath, BrokerDesc brokerDesc) {
+        this.remoteRepositoryPath = remoteRepositoryPath;
+        this.brokerDesc = brokerDesc;
+        this.currentDppVersion = FeConstants.spark_dpp_version;
+        currentArchive = new SparkArchive(getRemoteArchivePath(currentDppVersion), currentDppVersion);
+        this.rwLock = new ReentrantReadWriteLock();
+        this.isInit = false;
+        this.localDppPath = PaloFe.DORIS_HOME_DIR + "/spark-dpp/spark-dpp.jar";
+        if (!Strings.isNullOrEmpty(Config.spark_resource_path)) {
+            this.localSpark2xPath = Config.spark_resource_path;
+        } else {
+            this.localSpark2xPath = Config.spark_home_default_dir + "/jars/spark-2x.zip";
+        }
+    }
+
+    public boolean prepare() throws LoadException {
+        if (!isInit) {
+            initRepository();
+        }
+        return isInit;
+    }
+
+    private void initRepository() throws LoadException {
+        LOG.info("start to init remote repository");
+        boolean needUpload = false;
+        boolean needReplace = false;
+        CHECK: {
+            if (Strings.isNullOrEmpty(remoteRepositoryPath) || brokerDesc == null) {
+                break CHECK;
+            }
+
+            if (!checkCurrentArchiveExists()) {
+                needUpload = true;
+                break CHECK;
+            }
+
+            // init current archive
+            String remoteArchivePath = getRemoteArchivePath(currentDppVersion);
+            List<SparkLibrary> libraries = Lists.newArrayList();
+            getLibraries(remoteArchivePath, libraries);
+            if (libraries.size() != 2) {
+                needUpload = true;
+                needReplace = true;
+                break CHECK;
+            }
+            currentArchive.libraries.addAll(libraries);
+            for (SparkLibrary library : currentArchive.libraries) {
+                String localMd5sum = null;
+                switch (library.libType) {
+                    case DPP:
+                        localMd5sum = getMd5String(localDppPath);
+                        break;
+                    case SPARK2X:
+                        localMd5sum = getMd5String(localSpark2xPath);
+                        break;
+                    default:
+                        Preconditions.checkState(false, "wrong library type: " + library.libType);
+                        break;
+                }
+                if (!localMd5sum.equals(library.md5sum)) {
+                    needUpload = true;
+                    needReplace = true;
+                    break;
+                }
+            }
+        }
+
+        if (needUpload) {
+            uploadArchive(needReplace);
+        }
+        isInit = true;
+        LOG.info("init spark repository success, current dppVersion={}, archive path={}, libraries size={}",
+                currentDppVersion, currentArchive.remotePath, currentArchive.libraries.size());
+    }
+
+    public boolean checkCurrentArchiveExists() {
+        boolean result = false;
+        Preconditions.checkNotNull(remoteRepositoryPath);
+        String remotePath = getRemoteArchivePath(currentDppVersion);
+        readLock();
+        try {
+            result = BrokerUtil.checkPathExist(remotePath, brokerDesc);
+            LOG.info("check archive exists in repository, {}", result);
+        } catch (UserException e) {
+            LOG.warn("Failed to check remote archive exist, path={}, version={}", remotePath, currentDppVersion);
+        } finally {
+            readUnlock();
+        }
+        return result;
+    }
+
+    private void uploadArchive(boolean isReplace) throws LoadException {
+        writeLock();
+        try {
+            String remoteArchivePath = getRemoteArchivePath(currentDppVersion);
+            if (isReplace) {
+                BrokerUtil.deletePath(remoteArchivePath, brokerDesc);
+                currentArchive.libraries.clear();
+            }
+            String srcFilePath = null;
+            // upload dpp
+            {
+                srcFilePath = localDppPath;
+                String md5sum = getMd5String(srcFilePath);
+                long size = getFileSize(srcFilePath);
+                String fileName = getFileName(PATH_DELIMITER, srcFilePath);
+                String destFilePath = remoteArchivePath + PATH_DELIMITER +
+                        assemblyFileName(PREFIX_LIB, md5sum, fileName, "");
+                upload(srcFilePath, destFilePath);
+                currentArchive.libraries.add(new SparkLibrary(destFilePath, md5sum, SparkLibrary.LibType.DPP, size));
+            }
+            // upload spark2x
+            {
+                srcFilePath = localSpark2xPath;
+                String md5sum = getMd5String(srcFilePath);
+                long size = getFileSize(srcFilePath);
+                String fileName = getFileName(PATH_DELIMITER, srcFilePath);
+                String destFilePath = remoteArchivePath + PATH_DELIMITER +
+                        assemblyFileName(PREFIX_LIB, md5sum, fileName, "");
+                upload(srcFilePath, destFilePath);
+                currentArchive.libraries.add(new SparkLibrary(destFilePath, md5sum, SparkLibrary.LibType.SPARK2X, size));
+            }
+            LOG.info("finished to upload archive to repository, currentDppVersion={}, path={}",
+                    currentDppVersion, remoteArchivePath);
+        } catch (UserException e) {
+            throw new LoadException(e.getMessage());
+        } finally {
+            writeUnlock();
+        }
+    }
+
+    private void getLibraries(String remoteArchivePath, List<SparkLibrary> libraries) throws LoadException {
+        List<TBrokerFileStatus> fileStatuses = Lists.newArrayList();
+        readLock();
+        try {
+            LOG.info("input remote archive path, path={}", remoteArchivePath);
+            BrokerUtil.parseFile(remoteArchivePath + "/*", brokerDesc, fileStatuses);
+        } catch (UserException e) {
+            throw new LoadException(e.getMessage());
+        } finally {
+            readUnlock();
+        }
+
+        LOG.info("get file statuses, size={} ", fileStatuses.size());
+        for (TBrokerFileStatus fileStatus : fileStatuses) {
+            LOG.info("get file status " + fileStatus.path);
+            String fileName = getFileName(PATH_DELIMITER, fileStatus.path);
+            LOG.info("get file name " + fileName);
+            if (!fileName.startsWith(PREFIX_LIB)) {
+                continue;
+            }
+            String[] lib_arg = unWrap(PREFIX_LIB, SUFFIX, fileName).split(FILE_NAME_SEPARATOR);
+            LOG.info("get lib arg, length={}, arg[0]={}, arg[1]={}", lib_arg.length, lib_arg[0], lib_arg[1]);
+            if (lib_arg.length != 2) {
+                continue;
+            }
+            String md5sum = lib_arg[0];
+            String type = lib_arg[1];
+            SparkLibrary.LibType libType = null;
+            switch (type) {
+                case SPARK_DPP:
+                    libType = SparkLibrary.LibType.DPP;
+                    break;
+                case SPARK_2X:
+                    libType = SparkLibrary.LibType.SPARK2X;
+                    break;
+                default:
+                    Preconditions.checkState(false, "wrong library type: " + type);
+                    break;
+            }
+            SparkLibrary remoteFile = new SparkLibrary(fileStatus.path, md5sum, libType, fileStatus.size);
+            libraries.add(remoteFile);
+            LOG.info("get Libraries from remote archive, archive path={}, library={}, md5sum={}, size={}",
+                    remoteArchivePath, remoteFile.remotePath, remoteFile.md5sum, remoteFile.size);
+        }
+    }
+
+    private String getMd5String(String filePath) throws LoadException {
+        File file = new File(filePath);
+        String md5sum = null;
+        try {
+            md5sum = DigestUtils.md5Hex(new FileInputStream(file));
+            Preconditions.checkNotNull(md5sum);
+            LOG.info("get md5sum from file {}, md5sum={}", filePath, md5sum);

Review comment:
       debug

##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/SparkResource.java
##########
@@ -117,6 +117,10 @@ public String getWorkingDir() {
         return workingDir;
     }
 
+    public String getRepositoryDir() {
+        return workingDir + "/" + SparkRepository.REPOSITORY_DIR;

Review comment:
       better add a `cluster_id` in path




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org