Hi Penghui, Thanks for the suggestion.
First, I changed the method to findFirstEntryMetadata because I think it's more common to look for the first matching entry compared to finding the entry of the last match, e.g. to look for the first position greater than or equal to a specific publish time. As to return of 'RawEntryMetadata' is to reduce the complexity of the implementation of considerations, because when we use binary search managing the payload reference counter is complex. I think this method just returns entry metadata, If we need to get payload then we can be called again to call the readCompactedEntries method. Thanks, Cong Zhao On 2023/08/28 01:31:14 PengHui Li wrote: > Hi Cong, > > Thanks for driving the proposal. > Is it better to use `readNewestCompactedEntry(@Nonnull > Predicate<RawEntryMetadata> condition)` > > So that you don't need to introduce a new interface, RawEntryMetadata > And it's a more general solution for the TopicCompactionService. > > WDYT? > > Regards, > Penghui > > On Tue, Jul 25, 2023 at 12:12 PM Cong Zhao <zhaoc...@apache.org> wrote: > > > Hi Pulsar Community, I am writing to start the discussion on PIP 286 PR > > with PIP contents: https://github.com/apache/pulsar/pull/20867 Thanks, > > Cong Zhao > > >