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

    https://github.com/apache/spark/pull/1256#discussion_r17456928
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1307,6 +1307,43 @@ private[spark] object Utils extends Logging {
         }
       }
     
    +  /** Load properties present in the given file. */
    +  def getPropertiesFromFile(filename: String): Seq[(String, String)] = {
    +    val file = new File(filename)
    +    require(file.exists(), s"Properties file $file does not exist")
    +    require(file.isFile(), s"Properties file $file is not a normal file")
    +    val inputStream = new FileInputStream(file)
    +    getPropertiesFromInputStream(inputStream)
    +  }
    +
    +  /**
    +    * Load properties present in the given inputStream.
    +    * @param inputStream  InputStream from where to load properties.
    +    *                     Expected to contain UTF-8 data. Will be closed 
by this method.
    +    */
    +  private[spark] def getPropertiesFromInputStream(inputStream: 
InputStream):
    --- End diff --
    
    You don't need to put this in a separate function. We won't ever read the 
Spark configs from another input stream that's not a file, so this can just go 
into `getPropertiesFromFile`


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