Commit 2ecb75fe authored by ligang's avatar ligang
Browse files

add initBasePath

parent 1d0ca07b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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
     */