Skip to content

Commit daccc82

Browse files
committed
SPARK-3276 Changed the property name to reflect the unit of value and reduced number of fields.
* Changed the property name to spark.streaming.minRememberDurationMin to reflect the unit of value (minutes). * Deleted the constant MIN_REMEMBER_DURATION, because now minRememberDurationMin is serving the same purpose.
1 parent 43cc1ce commit daccc82

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

streaming/src/main/scala/org/apache/spark/streaming/dstream/FileInputDStream.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import org.apache.spark.util.{TimeStampedHashMap, Utils}
6363
* the streaming app.
6464
* - If a file is to be visible in the directory listings, it must be visible within a certain
6565
* duration of the mod time of the file. This duration is the "remember window", which is set to
66-
* 1 minute (see `FileInputDStream.MIN_REMEMBER_DURATION`). Otherwise, the file will never be
66+
* 1 minute (see `FileInputDStream.minRememberDurationMin`). Otherwise, the file will never be
6767
* selected as the mod time will be less than the ignore threshold when it becomes visible.
6868
* - Once a file is visible, the mod time cannot change. If it does due to appends, then the
6969
* processing semantics are undefined.
@@ -336,16 +336,17 @@ object FileInputDStream {
336336
* Files with mod times older than this "window" of remembering will be ignored. So if new
337337
* files are visible within this window, then the file will get selected in the next batch.
338338
*/
339-
private val minRememberDuration = new SparkConf().get("spark.streaming.minRememberDuration", "1")
340-
private val MIN_REMEMBER_DURATION = Minutes(minRememberDuration.toLong)
339+
private val minRememberDurationMin = Minutes(new SparkConf()
340+
.get("spark.streaming.minRememberDurationMin", "1")
341+
.toLong)
341342

342343
def defaultFilter(path: Path): Boolean = !path.getName().startsWith(".")
343344

344345
/**
345346
* Calculate the number of last batches to remember, such that all the files selected in
346-
* at least last MIN_REMEMBER_DURATION duration can be remembered.
347+
* at least last minRememberDurationMin duration can be remembered.
347348
*/
348349
def calculateNumBatchesToRemember(batchDuration: Duration): Int = {
349-
math.ceil(MIN_REMEMBER_DURATION.milliseconds.toDouble / batchDuration.milliseconds).toInt
350+
math.ceil(minRememberDurationMin.milliseconds.toDouble / batchDuration.milliseconds).toInt
350351
}
351352
}

0 commit comments

Comments
 (0)