當前位置: 首頁>>代碼示例>>Java>>正文


Java Path.mergePaths方法代碼示例

本文整理匯總了Java中org.apache.hadoop.fs.Path.mergePaths方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.mergePaths方法的具體用法?Java Path.mergePaths怎麽用?Java Path.mergePaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.fs.Path的用法示例。


在下文中一共展示了Path.mergePaths方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: formPath

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path formPath(String dirOrFile1, String dirOrFile2)
{
    String base = config.getMetaserverStore();
    String path1 = dirOrFile1;
    String path2 = dirOrFile2;
    while (base.endsWith("/")) {
        base = base.substring(0, base.length() - 2);
    }
    if (!path1.startsWith("/")) {
        path1 = "/" + path1;
    }
    if (path1.endsWith("/")) {
        path1 = path1.substring(0, path1.length() - 2);
    }
    if (!path2.startsWith("/")) {
        path2 = "/" + path2;
    }
    return Path.mergePaths(Path.mergePaths(new Path(base), new Path(path1)), new Path(path2));
}
 
開發者ID:dbiir,項目名稱:paraflow,代碼行數:20,代碼來源:MetaDataQuery.java

示例2: formPath

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path formPath(String dirOrFile)
{
    String base = config.getHDFSWarehouse();
    String path = dirOrFile;
    while (base.endsWith("/")) {
        base = base.substring(0, base.length() - 2);
    }
    if (!path.startsWith("/")) {
        path = "/" + path;
    }
    return Path.mergePaths(new Path(base), new Path(path));
}
 
開發者ID:dbiir,項目名稱:paraflow,代碼行數:13,代碼來源:FSFactory.java

示例3: addPrefix

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
protected Path addPrefix(Path path) {
  return Path.mergePaths(new Path(PATH_PREFIX), path);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:4,代碼來源:TestHttpFSFileSystemLocalFileSystem.java

示例4: createWithFullSchema

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
public static FileSelection createWithFullSchema(final FileSystemWrapper fs, final String parent, final String fullSchemaPath) throws IOException {
  final Path combined = Path.mergePaths(new Path(parent), PathUtils.toFSPath(fullSchemaPath));
  return create(fs, combined);
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:5,代碼來源:FileSelection.java

示例5: getUploadLocation

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path getUploadLocation(FilePath filePath, String extension) {
  FilePath filePathWithExtension = filePath.rename(format("%s_%s", filePath.getFileName().getName(), extension));
  return Path.mergePaths(config.getUploadsDir(), PathUtils.toFSPath(filePathWithExtension.toPathList()));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:5,代碼來源:HomeFileTool.java

示例6: getStagingLocation

import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
/**
 * Temporary location for file upload.
 * Add uuid so that this location remains unique even across file renames.
 * @param filePath file path in under home space
 * @param extension file extension
 * @return location of staging dir where user file is uploaded.
 */
private Path getStagingLocation(FilePath filePath, String extension) {
  FilePath uniquePath = filePath.rename(format("%s_%s-%s", filePath.getFileName().toString(), extension, UUID.randomUUID().toString()));
  return Path.mergePaths(config.getStagingDir(), PathUtils.toFSPath(uniquePath.toPathList()));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:12,代碼來源:HomeFileTool.java


注:本文中的org.apache.hadoop.fs.Path.mergePaths方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。