-
Improvement
-
Resolution: Done
-
Medium
-
None
Navigating through the implementation details is rather daunting, as there are four implementations of JournalWriter:
- SegmentedJournalWriter, given out via SegmentedJournalWriter.openWriter()
- MappableJournalSegmentWriter, used by JournalSegment, which forwards requests to one of
- FileChannelJournalSegmentWriter, used for buffered access
- MappedJournalSegmentWriter, used for memory-mapped access
The same holds true for JournalReader and makes navigating the codebase rather strange, as it would seem those four are equivalent, but they are not.
First, SegmentedJournalWriter is the only real implementation, hence it should be hosting the interface definition and be a final class.
Second, we should have an abstract class named JournalSegmentWriter, which holds the API contract and code shared between FileChannelJournalSegmentWriter and MappedJournalSegmentWriter.
Third, MappableJournalSegmentWriter seems to only be a lifecycle helper to deal with closing the channel, indexing and switching (potentially) mapping the file into memory. I think that class should just get integrated into JournalSegment.
- blocks
-
CONTROLLER-2099 Specialize JournalSegment to specified StorageLevel
- In Progress
- is blocked by
-
CONTROLLER-2043 Circuit breaker timeout with BGP and tell-based protocol
- Resolved
-
CONTROLLER-2096 Share a single FileChannel between FileChannelJournalSegmentWriter and its readers
- Resolved