HeartSaVioR commented on a change in pull request #28363:
URL: https://github.com/apache/spark/pull/28363#discussion_r532185599
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLog.scala
##########
@@ -96,6 +97,19 @@ class FileStreamSinkLog(
require(defaultCompactInterval > 0,
s"Please set ${SQLConf.FILE_SINK_LOG_COMPACT_INTERVAL.key} (was
$defaultCompactInterval) " +
"to a positive value.")
+
+ private val ttlMs = outputTimeToLiveMs.getOrElse(Long.MaxValue)
+
+ override def shouldRetain(log: SinkFileStatus): Boolean = {
+ val curTime = System.currentTimeMillis()
Review comment:
Probably we could change the method signature a bit to provide "context"
which would be same for the same compact batch. We changed the method
`shouldRetain` in SPARK-30462 which is not yet released (3.1.0), hence making
change shouldn't make backward compatibility for this change. (We decided to
break the interface, but we break only once for these changes.)
Once we only call `System.currentTimeMillis()` once per compact batch the
overhead should be ignorable.
----------------------------------------------------------------
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]