Github user steveloughran commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14371#discussion_r74684971
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala
 ---
    @@ -231,13 +232,17 @@ private[streaming] class FileBasedWriteAheadLog(
         val logDirectoryPath = new Path(logDirectory)
         val fileSystem = HdfsUtils.getFileSystemForPath(logDirectoryPath, 
hadoopConf)
     
    -    if (fileSystem.exists(logDirectoryPath) &&
    -        fileSystem.getFileStatus(logDirectoryPath).isDirectory) {
    -      val logFileInfo = 
logFilesTologInfo(fileSystem.listStatus(logDirectoryPath).map { _.getPath })
    -      pastLogs.clear()
    -      pastLogs ++= logFileInfo
    -      logInfo(s"Recovered ${logFileInfo.size} write ahead log files from 
$logDirectory")
    -      logDebug(s"Recovered files 
are:\n${logFileInfo.map(_.path).mkString("\n")}")
    +    try {
    +      if (fileSystem.getFileStatus(logDirectoryPath).isDirectory) {
    --- End diff --
    
    If you call `listStatus(file)` it returns a stat of the file, rather than 
listing of the children. Irritating as it's hard to differentiate 
listStatus(file) and listStatus(dir-with-one-child) except by examining the 
name of the returned status, and once you've got symlinks in the mix that 
differentiation isn't easy (The standard FileSystem globber has to jump though 
these hoops, hoops a dedicated s3a globber can/will avoid)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to