作者: | 来源:互联网 | 2023-08-16 13:55
本文整理了Java中org.apache.hadoop.fs.AbstractFileSystem.getUriPath()
方法的一些代码示例,展示了AbstractFileSystem.getUriPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractFileSystem.getUriPath()
方法的具体详情如下:
包路径:org.apache.hadoop.fs.AbstractFileSystem
类名称:AbstractFileSystem
方法名:getUriPath
AbstractFileSystem.getUriPath介绍
[英]Get the path-part of a pathname. Checks that URI matches this file system and that the path-part is a valid name.
[中]获取路径名的路径部分。检查URI是否与此文件系统匹配,以及路径部分是否为有效名称。
代码示例
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public String getUriPath(final Path p) {
return myFs.getUriPath(p);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
public ChRootedFs(final AbstractFileSystem fs, final Path theRoot)
throws URISyntaxException {
super(fs.getUri(), fs.getUri().getScheme(), false, fs.getUriDefaultPort());
myFs = fs;
myFs.checkPath(theRoot);
chRootPathPart = new Path(myFs.getUriPath(theRoot));
chRootPathPartString = chRootPathPart.toUri().getPath();
/*
* We are making URI include the chrootedPath: e.g. file:///chrootedPath.
* This is questionable since Path#makeQualified(uri, path) ignores
* the pathPart of a uri. Since this class is internal we can ignore
* this issue but if we were to make it external then this needs
* to be resolved.
*/
// Handle the two cases:
// scheme:/// and scheme://authority/
myUri = new URI(myFs.getUri().toString() +
(myFs.getUri().getAuthority() == null ? "" : Path.SEPARATOR) +
chRootPathPart.toUri().getPath().substring(1));
super.checkPath(theRoot);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
@Override
public String getUriPath(final Path p) {
return myFs.getUriPath(p);
}
代码示例来源:origin: io.hops/hadoop-common
@Override
public String getUriPath(final Path p) {
return myFs.getUriPath(p);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Override
public String getUriPath(final Path p) {
return myFs.getUriPath(p);
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
@Override
public String getUriPath(final Path p) {
return myFs.getUriPath(p);
}
代码示例来源:origin: NetApp/NetApp-Hadoop-NFS-Connector
@Override
public String getUriPath(final Path p) {
LOG.debug("getUriPath(): path=" + p);
String s = super.getUriPath(p);
LOG.debug("getUriPath(): super returned string=" + s);
return s;
}
代码示例来源:origin: io.hops/hadoop-common
public ChRootedFs(final AbstractFileSystem fs, final Path theRoot)
throws URISyntaxException {
super(fs.getUri(), fs.getUri().getScheme(), false, fs.getUriDefaultPort());
myFs = fs;
myFs.checkPath(theRoot);
chRootPathPart = new Path(myFs.getUriPath(theRoot));
chRootPathPartString = chRootPathPart.toUri().getPath();
/*
* We are making URI include the chrootedPath: e.g. file:///chrootedPath.
* This is questionable since Path#makeQualified(uri, path) ignores
* the pathPart of a uri. Since this class is internal we can ignore
* this issue but if we were to make it external then this needs
* to be resolved.
*/
// Handle the two cases:
// scheme:/// and scheme://authority/
myUri = new URI(myFs.getUri().toString() +
(myFs.getUri().getAuthority() == null ? "" : Path.SEPARATOR) +
chRootPathPart.toUri().getPath().substring(1));
super.checkPath(theRoot);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
public ChRootedFs(final AbstractFileSystem fs, final Path theRoot)
throws URISyntaxException {
super(fs.getUri(), fs.getUri().getScheme(), false, fs.getUriDefaultPort());
myFs = fs;
myFs.checkPath(theRoot);
chRootPathPart = new Path(myFs.getUriPath(theRoot));
chRootPathPartString = chRootPathPart.toUri().getPath();
/*
* We are making URI include the chrootedPath: e.g. file:///chrootedPath.
* This is questionable since Path#makeQualified(uri, path) ignores
* the pathPart of a uri. Since this class is internal we can ignore
* this issue but if we were to make it external then this needs
* to be resolved.
*/
// Handle the two cases:
// scheme:/// and scheme://authority/
myUri = new URI(myFs.getUri().toString() +
(myFs.getUri().getAuthority() == null ? "" : Path.SEPARATOR) +
chRootPathPart.toUri().getPath().substring(1));
super.checkPath(theRoot);
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
public ChRootedFs(final AbstractFileSystem fs, final Path theRoot)
throws URISyntaxException {
super(fs.getUri(), fs.getUri().getScheme(), false, fs.getUriDefaultPort());
myFs = fs;
myFs.checkPath(theRoot);
chRootPathPart = new Path(myFs.getUriPath(theRoot));
chRootPathPartString = chRootPathPart.toUri().getPath();
/*
* We are making URI include the chrootedPath: e.g. file:///chrootedPath.
* This is questionable since Path#makeQualified(uri, path) ignores
* the pathPart of a uri. Since this class is internal we can ignore
* this issue but if we were to make it external then this needs
* to be resolved.
*/
// Handle the two cases:
// scheme:/// and scheme://authority/
myUri = new URI(myFs.getUri().toString() +
(myFs.getUri().getAuthority() == null ? "" : Path.SEPARATOR) +
chRootPathPart.toUri().getPath().substring(1));
super.checkPath(theRoot);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
public ChRootedFs(final AbstractFileSystem fs, final Path theRoot)
throws URISyntaxException {
super(fs.getUri(), fs.getUri().getScheme(),
fs.getUri().getAuthority() != null, fs.getUriDefaultPort());
myFs = fs;
myFs.checkPath(theRoot);
chRootPathPart = new Path(myFs.getUriPath(theRoot));
chRootPathPartString = chRootPathPart.toUri().getPath();
/*
* We are making URI include the chrootedPath: e.g. file:///chrootedPath.
* This is questionable since Path#makeQualified(uri, path) ignores
* the pathPart of a uri. Since this class is internal we can ignore
* this issue but if we were to make it external then this needs
* to be resolved.
*/
// Handle the two cases:
// scheme:/// and scheme://authority/
myUri = new URI(myFs.getUri().toString() +
(myFs.getUri().getAuthority() == null ? "" : Path.SEPARATOR) +
chRootPathPart.toUri().getPath().substring(1));
super.checkPath(theRoot);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
static AbstractFileSystem getMockFs(URI uri) {
AbstractFileSystem mockFs = fsCache.get(uri.getAuthority());
if (mockFs == null) {
mockFs = mock(AbstractFileSystem.class);
when(mockFs.getUri()).thenReturn(uri);
when(mockFs.getUriDefaultPort()).thenReturn(1);
when(mockFs.getUriPath(any(Path.class))).thenCallRealMethod();
when(mockFs.isValidName(anyString())).thenReturn(true);
fsCache.put(uri.getAuthority(), mockFs);
}
return mockFs;
}
}