HeartSaVioR commented on a change in pull request #25670: [SPARK-28869][CORE]
Roll over event log files
URL: https://github.com/apache/spark/pull/25670#discussion_r328401390
##########
File path:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -574,22 +576,27 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
}
}
- private[history] def shouldReloadLog(info: LogInfo, entry: FileStatus):
Boolean = {
- var result = info.fileSize < entry.getLen
- if (!result && info.logPath.endsWith(EventLoggingListener.IN_PROGRESS)) {
- try {
- result = Utils.tryWithResource(fs.open(entry.getPath)) { in =>
- in.getWrappedStream match {
- case dfsIn: DFSInputStream => info.fileSize < dfsIn.getFileLength
- case _ => false
- }
+ private[history] def shouldReloadLog(info: LogInfo, reader:
EventLogFileReader): Boolean = {
+ if (info.isComplete != reader.completed) {
+ true
+ } else {
+ var result = if (info.lastSequenceNum.isDefined) {
+ require(reader.lastIndex.isDefined)
+ info.lastSequenceNum.get < reader.lastIndex.get ||
Review comment:
Missed one. Will rename to lastIndex.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]