abstractdog commented on code in PR #309:
URL: https://github.com/apache/tez/pull/309#discussion_r1342689615


##########
tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java:
##########
@@ -118,34 +121,28 @@
 @Private
 public final class TezClientUtils {
 
-  private static Logger LOG = LoggerFactory.getLogger(TezClientUtils.class);
+  private static final Logger LOG = 
LoggerFactory.getLogger(TezClientUtils.class);
   private static final int UTF8_CHUNK_SIZE = 16 * 1024;
 
   private TezClientUtils() {}
 
-  private static FileStatus[] getLRFileStatus(String fileName, Configuration 
conf) throws
-      IOException {
-    URI uri;
+  private static RemoteIterator<LocatedFileStatus> 
getListFilesFileStatus(String fileName, Configuration conf)
+      throws IOException {
+    Path p = getPath(fileName);
+    FileSystem fs = p.getFileSystem(conf);
+    p = fs.resolvePath(p.makeQualified(fs.getUri(), fs.getWorkingDirectory()));
+    FileSystem targetFS = p.getFileSystem(conf);
+    return targetFS.listFiles(p, false);

Review Comment:
   as far as I can understand, this single listFiles call can be used instead 
of a "directory or file" check, making this method simpler, looks good



-- 
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]

Reply via email to