BP-47 (task3): Abstract interface for entrylogger#3197
BP-47 (task3): Abstract interface for entrylogger#3197eolivelli merged 8 commits intoapache:masterfrom
Conversation
dee84ae to
777918b
Compare
|
@merlimat @eolivelli @dlg99 @mauricebarnum Please help take a look, Thanks a lot. |
|
It looks like the first commit was made by @ivankelly ? We should keep this reference and explicitly state this in the description of the PR |
@eolivelli Yes, The commit made by @ivankelly . This is the sub task of #2932 , which pushed out by @mauricebarnum. However, this PR contains too many changes and the number of code lines reaches 8K+, and it is hard to review. According to your suggestion #2932 (comment), and after communicate with @mauricebarnum, we are planing to divide the PR into 6 PRs, Please refer to #2943 (comment). However, @mauricebarnum doesn't have enough time to deal with those issues, and we desperately need this feature. After communicated with @mauricebarnum and @merlimat , I help to work on divide the PRs and push them out. We are hoping to contain this feature in BookKeeper 4.16.0 |
Define the interface and contract for entrylogger. This is mostly taking the entrylogger methods used by other components and prettying them up a bit. Notable changes are: - internalReadEntry is now readEntry. There is no 'validate' flag. Instead there are two overloads for the method, and validation only runs if ledgerId and entryId are passed in. - shutdown has been renamed to close. - the compaction entrylog methods have been put behind an interface. As it was they were leaking implementation details. Ultimitely compaction itself should be hidden behind the entrylogger, but that's a larger refactor. (cherry picked from commit c927f4b)
26926b5 to
f0e8b3a
Compare
dlg99
left a comment
There was a problem hiding this comment.
Overall LGTM.
Couple of points to address:
- UNASSIGNED_LEDGERID should be kept in the EntryLogger interface to be available/the same in all implementations
- fields and method params should use interface instead of concrete implementation
| static final long UNASSIGNED_LEDGERID = -1L; | ||
| // log file suffix | ||
| static final String LOG_FILE_SUFFIX = ".log"; |
There was a problem hiding this comment.
I think these should be kept in the EntryLogger interface because these are not implementation-specific (UNASSIGNED_LEDGERID - definitely, LOG_FILE_SUFFIX - discussable)
Co-authored-by: Andrey Yegorov <8622884+dlg99@users.noreply.github.com>
@dlg99 Thanks you for your patient review.
For current purposes, we will support dbLedgerStorage to use directIOEntryLogger first, and for other kind ledgerStorage implementation, we will consider to support later. For other kinds of ledgerStorage support, we should do more work on the EntryLogger interface abstraction in the future. So my suggestion is that currently we use |
|
rerun failure checks |
3 similar comments
|
rerun failure checks |
|
rerun failure checks |
|
rerun failure checks |
* Interface for entrylogger Define the interface and contract for entrylogger. This is mostly taking the entrylogger methods used by other components and prettying them up a bit. Notable changes are: - internalReadEntry is now readEntry. There is no 'validate' flag. Instead there are two overloads for the method, and validation only runs if ledgerId and entryId are passed in. - shutdown has been renamed to close. - the compaction entrylog methods have been put behind an interface. As it was they were leaking implementation details. Ultimitely compaction itself should be hidden behind the entrylogger, but that's a larger refactor. (cherry picked from commit c927f4b) * abstract interface for entrylogger * format code * format code * address comments * Apply suggestions from code review Co-authored-by: Andrey Yegorov <8622884+dlg99@users.noreply.github.com> * address comments * format code Co-authored-by: Ivan Kelly <ikelly@splunk.com> Co-authored-by: Andrey Yegorov <8622884+dlg99@users.noreply.github.com>
Motivation
Define the interface and contract for entrylogger. This is mostly taking the entrylogger methods used by other components and prettying them up a bit.
Notable Changes
EntryLoggerandCompactionEntryLoginterface. Provide common interface for read/write entries and entry log compaction.EntryLoggerclass toDefaultEntryLoggerto represent default entryLogger implementationEntryLogScannerinterface out of EntryLogger classCompactionEntryLoginterface.Sub task of #2932
Others
The commit is made by @ivankelly . This is the sub task of #2932 , which pushed out by @mauricebarnum. However, this PR contains too many changes and the number of code lines reaches 8K+, and it is hard to review. According to your suggestion #2932 (comment), and after communicate with @mauricebarnum, we are planing to divide the PR into 6 PRs, Please refer to #2943 (comment).
However, @mauricebarnum doesn't have enough time to deal with those issues, and we desperately need this feature. After communicated with @mauricebarnum and @merlimat , I help to work on divide the PRs and push them out. We are hoping to contain this feature in BookKeeper 4.16.0