public String getMetastoreBigCellHdfsDirectory() { if (cachedBigCellDirectory != null) return cachedBigCellDirectory; String root = getOptional("kylin.env.hdfs-metastore-bigcell-dir"); if (root == null) { return getJdbcHdfsWorkingDirectory(); } Path path = new Path(root); if (!path.isAbsolute()) throw new IllegalArgumentException( "kylin.env.hdfs-metastore-bigcell-dir must be absolute, but got " + root); // make sure path is qualified try { FileSystem fs = HadoopUtil.getReadFileSystem(); path = fs.makeQualified(path); } catch (IOException e) { throw new RuntimeException(e); } root = new Path(path, StringUtils.replaceChars(getMetadataUrlPrefix(), ':', '-')).toString(); if (!root.endsWith("/")) root += "/"; cachedBigCellDirectory = root; if (cachedBigCellDirectory.startsWith(FILE_SCHEME)) { cachedBigCellDirectory = cachedBigCellDirectory.replace(FILE_SCHEME, "file://"); } else if (cachedBigCellDirectory.startsWith(MAPRFS_SCHEME)) { cachedBigCellDirectory = cachedBigCellDirectory.replace(MAPRFS_SCHEME, "maprfs://"); } return cachedBigCellDirectory; }
public String getMetastoreBigCellHdfsDirectory() { if (cachedBigCellDirectory != null) return cachedBigCellDirectory; String root = getOptional("kylin.env.hdfs-metastore-bigcell-dir"); if (root == null) { return getJdbcHdfsWorkingDirectory(); } Path path = new Path(root); if (!path.isAbsolute()) throw new IllegalArgumentException( "kylin.env.hdfs-metastore-bigcell-dir must be absolute, but got " + root); // make sure path is qualified try { FileSystem fs = HadoopUtil.getReadFileSystem(); path = fs.makeQualified(path); } catch (IOException e) { throw new RuntimeException(e); } root = new Path(path, StringUtils.replaceChars(getMetadataUrlPrefix(), ':', '-')).toString(); if (!root.endsWith("/")) root += "/"; cachedBigCellDirectory = root; if (cachedBigCellDirectory.startsWith(FILE_SCHEME)) { cachedBigCellDirectory = cachedBigCellDirectory.replace(FILE_SCHEME, "file://"); } else if (cachedBigCellDirectory.startsWith(MAPRFS_SCHEME)) { cachedBigCellDirectory = cachedBigCellDirectory.replace(MAPRFS_SCHEME, "maprfs://"); } return cachedBigCellDirectory; }