public String getClusterName() { return this.getOptional("kylin.server.cluster-name", getMetadataUrlPrefix()); }
public String getHdfsWorkingDirectory() { if (cachedHdfsWorkingDirectory != null) return cachedHdfsWorkingDirectory; String root = getOptional("kylin.env.hdfs-working-dir", "/kylin"); Path path = new Path(root); if (!path.isAbsolute()) throw new IllegalArgumentException("kylin.env.hdfs-working-dir must be absolute, but got " + root); try { FileSystem fs = path.getFileSystem(HadoopUtil.getCurrentConfiguration()); path = fs.makeQualified(path); } catch (IOException e) { throw new RuntimeException(e); } // append metadata-url prefix root = new Path(path, StringUtils.replaceChars(getMetadataUrlPrefix(), ':', '-')).toString(); if (!root.endsWith("/")) root += "/"; cachedHdfsWorkingDirectory = root; if (cachedHdfsWorkingDirectory.startsWith(FILE_SCHEME)) { cachedHdfsWorkingDirectory = cachedHdfsWorkingDirectory.replace(FILE_SCHEME, "file://"); } else if (cachedHdfsWorkingDirectory.startsWith(MAPRFS_SCHEME)) { cachedHdfsWorkingDirectory = cachedHdfsWorkingDirectory.replace(MAPRFS_SCHEME, "maprfs://"); } return cachedHdfsWorkingDirectory; }
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 getClusterName() { return this.getOptional("kylin.server.cluster-name", getMetadataUrlPrefix()); }
public String getHdfsWorkingDirectory() { if (cachedHdfsWorkingDirectory != null) return cachedHdfsWorkingDirectory; String root = getOptional("kylin.env.hdfs-working-dir", "/kylin"); Path path = new Path(root); if (!path.isAbsolute()) throw new IllegalArgumentException("kylin.env.hdfs-working-dir must be absolute, but got " + root); try { FileSystem fs = path.getFileSystem(HadoopUtil.getCurrentConfiguration()); path = fs.makeQualified(path); } catch (IOException e) { throw new RuntimeException(e); } // append metadata-url prefix root = new Path(path, StringUtils.replaceChars(getMetadataUrlPrefix(), ':', '-')).toString(); if (!root.endsWith("/")) root += "/"; cachedHdfsWorkingDirectory = root; if (cachedHdfsWorkingDirectory.startsWith(FILE_SCHEME)) { cachedHdfsWorkingDirectory = cachedHdfsWorkingDirectory.replace(FILE_SCHEME, "file://"); } else if (cachedHdfsWorkingDirectory.startsWith(MAPRFS_SCHEME)) { cachedHdfsWorkingDirectory = cachedHdfsWorkingDirectory.replace(MAPRFS_SCHEME, "maprfs://"); } return cachedHdfsWorkingDirectory; }
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; }