Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/3389#discussion_r20682849
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/FileInputDStream.scala
---
@@ -37,22 +69,24 @@ class FileInputDStream[K: ClassTag, V: ClassTag, F <:
NewInputFormat[K,V] : Clas
newFilesOnly: Boolean = true)
extends InputDStream[(K, V)](ssc_) {
- protected[streaming] override val checkpointData = new
FileInputDStreamCheckpointData
+ protected[streaming] case class SelectedFileInfo(files: Array[String],
minModTime: Long)
- // files found in the last interval
- private val lastFoundFiles = new HashSet[String]
+ protected[streaming] override val checkpointData = new
FileInputDStreamCheckpointData
- // Files with mod time earlier than this is ignored. This is updated
every interval
- // such that in the current interval, files older than any file found in
the
- // previous interval will be ignored. Obviously this time keeps moving
forward.
- private var ignoreTime = if (newFilesOnly) System.currentTimeMillis()
else 0L
+ @transient private[streaming] var timeToSelectedFileInfo = new
HashMap[Time, SelectedFileInfo]
+ @transient private var allFoundFiles = new mutable.HashSet[String]()
+ @transient private var fileToModTimes = new TimeStampedHashMap[String,
Long](true)
--- End diff --
Would you mind adding a comment that this is a cache? Or maybe you could
call it `modTimeCache`? If you keep the current title, it should probably be
`fileToModTime` with no 's'.
---
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]