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

    https://github.com/apache/spark/pull/3466#discussion_r22241227
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/StreamingSource.scala ---
    @@ -62,6 +62,14 @@ private[streaming] class StreamingSource(ssc: 
StreamingContext) extends Source {
       registerGauge("lastCompletedBatch_processEndTime",
         _.lastCompletedBatch.flatMap(_.processingEndTime).getOrElse(-1L), -1L)
     
    +  // Gauge for last completed batch's delay information.
    +  registerGauge("lastCompletedBatch_processTime",
    +    _.lastCompletedBatch.flatMap(_.processingDelay).getOrElse(0L), -1L)
    --- End diff --
    
    Why is the default value different within getOrElse, and the explicit 
default value? In fact the default value should not have to be specified twice. 
Since the registerGauge function already takes care of the nulls using Option 
and default value, we should not require Options here. 
    



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