本文整理汇总了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));
}
示例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));
}
示例3: addPrefix
import org.apache.hadoop.fs.Path; //导入方法依赖的package包/类
protected Path addPrefix(Path path) {
return Path.mergePaths(new Path(PATH_PREFIX), path);
}
示例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);
}
示例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()));
}
示例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()));
}