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

    https://github.com/apache/spark/pull/898#discussion_r13118951
  
    --- Diff: core/src/main/scala/org/apache/spark/util/FileLogger.scala ---
    @@ -61,6 +61,16 @@ private[spark] class FileLogger(
       // Only defined if the file system scheme is not local
       private var hadoopDataStream: Option[FSDataOutputStream] = None
     
    +  // Find out the correct method to use to flush a hadoop data stream.
    +  private val hadoopFlushMethod = {
    +    val cls = classOf[FSDataOutputStream]
    +    if (cls.getMethod("hflush") != null) {
    --- End diff --
    
    By the way, the "Scala" way to do this may just be
    ```scala
    Try(cls.getMethod("hflush")).getOrElse(cls.getMethod("sync"))
    ```



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

Reply via email to