kowshik commented on a change in pull request #10478:
URL: https://github.com/apache/kafka/pull/10478#discussion_r611454958
##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -255,19 +261,21 @@ case object SnapshotGenerated extends
LogStartOffsetIncrementReason {
@threadsafe
class Log(@volatile private var _dir: File,
@volatile var config: LogConfig,
+ val segments: LogSegments,
Review comment:
I see your point. It's good thinking. But the main reason I didn't take
this route was that some of the fields of `LogComponents` are immutable within
the context of the `LogLoader`, but are mutable by `Log`. Examples:
`logStartOffset`, `recoveryPoint` and `leaderEpochCache ` are defined as `var`
only in `Log`. It seemed hard to explain if we made it a `var` inside
`LogComponents` just because the `Log` class wants to mutate them.
--
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]