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

    https://github.com/apache/spark/pull/5024#discussion_r26436131
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala ---
    @@ -43,10 +43,15 @@ class Checkpoint(@transient ssc: StreamingContext, val 
checkpointTime: Time)
       val delaySeconds = MetadataCleaner.getDelaySeconds(ssc.conf)
       val sparkConfPairs = ssc.conf.getAll
     
    -  def sparkConf = {
    -    new SparkConf(false).setAll(sparkConfPairs)
    +  def createSparkConf(): SparkConf = {
    +    val newSparkConf = new SparkConf(loadDefaults = 
false).setAll(sparkConfPairs)
           .remove("spark.driver.host")
           .remove("spark.driver.port")
    +    new SparkConf(loadDefaults = true).getOption("spark.master") match {
    +      case Some(newMaster) => newSparkConf.setMaster(newMaster)
    +      case _ => None
    --- End diff --
    
    Right, I can make it better by using foreach on option. That was stupid and
    too hurried.
    On Mar 14, 2015 12:05 AM, "Hari Shreedharan" <[email protected]>
    wrote:
    
    > In streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala
    > <https://github.com/apache/spark/pull/5024#discussion_r26436080>:
    >
    > >        .remove("spark.driver.host")
    > >        .remove("spark.driver.port")
    > > +    new SparkConf(loadDefaults = true).getOption("spark.master") match 
{
    > > +      case Some(newMaster) => newSparkConf.setMaster(newMaster)
    > > +      case _ => None
    >
    > case _ => should be enough, no? Is there a need to return None? (Since
    > None is an object, I am not sure what the real cost is in this case for
    > returning something - so this can be ignored if the cost here is ~zero)
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/spark/pull/5024/files#r26436080>.
    >



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