本文整理了Java中org.apache.hadoop.fs.Path.compareTo()
方法的一些代码示例,展示了Path.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.compareTo()
方法的具体详情如下:
包路径:org.apache.hadoop.fs.Path
类名称:Path
方法名:compareTo
暂无
代码示例来源:origin: apache/hive
private int comparePath(Path p1, Path p2) {
return p1.compareTo(p2);
}
}
代码示例来源:origin: apache/hive
@Override
public int compareTo(OrcFileKeyWrapper o) {
return inputPath.compareTo(o.inputPath);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public int compareTo(PathData o) {
return path.compareTo(o.path);
}
代码示例来源:origin: apache/drill
private int comparePath(Path p1, Path p2) {
return p1.compareTo(p2);
}
}
代码示例来源:origin: apache/drill
@Override
public int compareTo(OrcFileKeyWrapper o) {
return inputPath.compareTo(o.inputPath);
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public int compareTo(FileSystemDatasetVersion other) {
StringDatasetVersion otherAsString = (StringDatasetVersion) other;
return this.version.equals(otherAsString.version) ? this.path.compareTo(otherAsString.path) : this.version
.compareTo(otherAsString.version);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
/**
* Compare this FileStatus to another FileStatus
* @param o the FileStatus to be compared.
* @return a negative integer, zero, or a positive integer as this object
* is less than, equal to, or greater than the specified object.
*/
public int compareTo(FileStatus o) {
return this.getPath().compareTo(o.getPath());
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public int compareTo(FileSystemDatasetVersion other) {
FileStatusDatasetVersion otherAsFileStatus = (FileStatusDatasetVersion) other;
return this.fileStatus.getPath().compareTo(otherAsFileStatus.getFileStatus().getPath());
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public int compareTo(FileSystemDatasetVersion other) {
TimestampedDatasetVersion otherAsDateTime = (TimestampedDatasetVersion) other;
return this.version.equals(otherAsDateTime.version) ? this.path.compareTo(otherAsDateTime.path)
: this.version.compareTo(otherAsDateTime.version);
}
代码示例来源:origin: apache/incubator-gobblin
public int compareTo(DatasetVersion other) {
FileStatusDatasetVersion otherAsFileStatus = (FileStatusDatasetVersion) other;
return this.fileStatus.getPath().compareTo(otherAsFileStatus.getFileStatus().getPath());
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
private Path makeRelative(String initial, Path p) {
String scheme = this.uri.getScheme();
String authority = this.uri.getAuthority();
Path root = new Path(Path.SEPARATOR);
if (root.compareTo(p) == 0)
return new Path(scheme, authority, initial);
Path retPath = new Path(p.getName());
Path parent = p.getParent();
for (int i=0; i < p.depth()-1; i++) {
retPath = new Path(parent.getName(), retPath);
parent = parent.getParent();
}
return new Path(new Path(scheme, authority, initial),
retPath.toString());
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
/**
* this method returns the path
* inside the har filesystem.
* this is relative path inside
* the har filesystem.
* @param path the fully qualified path in the har filesystem.
* @return relative path in the filesystem.
*/
private Path getPathInHar(Path path) {
Path harPath = new Path(path.toUri().getPath());
if (archivePath.compareTo(harPath) == 0)
return new Path(Path.SEPARATOR);
Path tmp = new Path(harPath.getName());
Path parent = harPath.getParent();
while (!(parent.compareTo(archivePath) == 0)) {
if (parent.toString().equals(Path.SEPARATOR)) {
tmp = null;
break;
}
tmp = new Path(parent.getName(), tmp);
parent = parent.getParent();
}
if (tmp != null)
tmp = new Path(Path.SEPARATOR, tmp);
return tmp;
}
代码示例来源:origin: apache/hive
@Override
public int compare(FetchInputFormatSplit a, FetchInputFormatSplit b) {
final Path ap = a.getPath();
final Path bp = b.getPath();
if (ap != null) {
return (ap.compareTo(bp));
}
return Long.signum(a.getLength() - b.getLength());
}
}
代码示例来源:origin: apache/ignite
@SuppressWarnings("deprecation")
@Override public int compare(FileStatus o1, FileStatus o2) {
if (o1 == null || o2 == null)
return o1 == o2 ? 0 : o1 == null ? -1 : 1;
return o1.isDir() == o2.isDir() ? o1.getPath().compareTo(o2.getPath()) : o1.isDir() ? -1 : 1;
}
};
代码示例来源:origin: apache/hive
@Override
public int compare(InputSplit inp1, InputSplit inp2) {
FileSplit fs1 = (FileSplit) inp1;
FileSplit fs2 = (FileSplit) inp2;
int retval = fs1.getPath().compareTo(fs2.getPath());
if (retval != 0) {
return retval;
}
if (fs1.getStart() != fs2.getStart()) {
return (int) (fs1.getStart() - fs2.getStart());
}
return 0;
}
}
代码示例来源:origin: apache/drill
@Override
public int compare(InputSplit inp1, InputSplit inp2) {
FileSplit fs1 = (FileSplit) inp1;
FileSplit fs2 = (FileSplit) inp2;
int retval = fs1.getPath().compareTo(fs2.getPath());
if (retval != 0) {
return retval;
}
if (fs1.getStart() != fs2.getStart()) {
return (int) (fs1.getStart() - fs2.getStart());
}
return 0;
}
}
代码示例来源:origin: apache/hive
FileSplit fs2 = (FileSplit) o2;
if (fs1.getPath() != null && fs2.getPath() != null) {
int pathComp = (fs1.getPath().compareTo(fs2.getPath()));
if (pathComp == 0) {
代码示例来源:origin: apache/drill
FileSplit fs2 = (FileSplit) o2;
if (fs1.getPath() != null && fs2.getPath() != null) {
int pathComp = (fs1.getPath().compareTo(fs2.getPath()));
if (pathComp == 0) {
代码示例来源:origin: apache/accumulo
@Override
public int compareTo(FileRef o) {
return suffix.compareTo(o.suffix);
}
代码示例来源:origin: apache/hive
fsd1.getDirName().compareTo(fsd2.getDirName()));
for (FileSinkDesc desc : acidSinks) {
TableDesc tableInfo = desc.getTableInfo();
内容来源于网络,如有侵权,请联系作者删除!