zsxwing commented on a change in pull request #28363:
URL: https://github.com/apache/spark/pull/28363#discussion_r532298282



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLog.scala
##########
@@ -112,7 +112,16 @@ abstract class CompactibleFileStreamLog[T <: AnyRef : 
ClassTag](
    * Default implementation retains all log entries. Implementations should 
override the method
    * to change the behavior.
    */
-  def shouldRetain(log: T): Boolean = true
+  def shouldRetain(log: T, context: Map[String, Any]): Boolean = true

Review comment:
       I feel adding `context` is overkill. How about passing the now timestamp 
into this instead? We can add the retain context like this in future if that's 
necessary:
   
   ```
   def shouldRetain(log: T, currentTime: Long): Boolean = true
   
   def shouldRetain(log: T, context: Map[String, Any]): Boolean = {
     shouldRetain(log, context.get("currentTime").asInstanceOf[Long])
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to