gaborgsomogyi commented on a change in pull request #26416:
[WIP][SPARK-29779][CORE] Compact old event log files and cleanup
URL: https://github.com/apache/spark/pull/26416#discussion_r344626898
##########
File path:
core/src/main/scala/org/apache/spark/deploy/history/EventLogFileReaders.scala
##########
@@ -218,12 +219,24 @@ class RollingEventLogFilesFileReader(
private lazy val eventLogFiles: Seq[FileStatus] = {
val eventLogFiles = files.filter(isEventLogFile).sortBy { status =>
- getIndex(status.getPath.getName)
+ val filePath = status.getPath
+ var idx = getIndex(status.getPath.getName) + 0.0d
Review comment:
A little bit bothers that `isEventLogFile` and `getIndex` ha a copy-pasted
condition (`startsWith(EVENT_LOG_FILE_NAME_PREFIX)`). Maybe this can be avoided
if `getIndex` would get `FileStatus` and then the following precondition?
`require(isEventLogFile(status), "Not an event log file!")`
The other option is just extract the mentioned code into a function.
----------------------------------------------------------------
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]