JackyYangPassion commented on code in PR #571:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/pull/571#discussion_r1529651716
##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/reader/hdfs/HDFSFileReader.java:
##########
@@ -109,7 +125,18 @@ protected List<Readable> scanReadables() throws
IOException {
paths.add(new HDFSFile(this.hdfs, path));
} else {
assert this.hdfs.isDirectory(path);
- FileStatus[] statuses = this.hdfs.listStatus(path);
+ FileStatus[] statuses;
+ if (prefix == null || prefix.isEmpty()) {
+ statuses = this.hdfs.listStatus(path);
+ } else {
+ PathFilter prefixFilter = new PathFilter() {
+ @Override
+ public boolean accept(Path path) {
+ return path.getName().startsWith(prefix);
+ }
+ };
+ statuses = this.hdfs.listStatus(path,prefixFilter);
+ }
Review Comment:
The HDFSFileReader supports filename prefixes just for the convenience of
data warehouse edge table loading, so I believe it's better to stick to a fixed
usage and not recommend multiple ways of writing the path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]