From 2ecb75fe86c3f6a8209b67f7feaa7646f1fabeee Mon Sep 17 00:00:00 2001 From: ligang Date: Thu, 23 May 2019 11:32:42 +0800 Subject: [PATCH] add initBasePath --- .../java/cn/escheduler/common/utils/HadoopUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java index bba9e610fc..b3ba7f5b8c 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java @@ -100,6 +100,7 @@ public class HadoopUtils implements Closeable { logger.info("appAddress : {}", appAddress); } configuration.set(Constants.YARN_APPLICATION_STATUS_ADDRESS, appAddress); + initBasePath(); } catch (Exception e) { logger.error(e.getMessage(), e); } @@ -109,6 +110,17 @@ public class HadoopUtils implements Closeable { } } + /** + * init data.store2hdfs.basepath in common.properties + * @throws IOException + */ + private void initBasePath() throws IOException { + Path path = new Path(getString(DATA_STORE_2_HDFS_BASEPATH)); + if( !fs.exists(path) ){ + fs.mkdirs(path); + } + } + /** * @return Configuration */