Skip to content

[Enhancement] Optimize code that uses cursor.getNumberOfEntriesInBacklog(true) > 0 #26036

@lhotari

Description

@lhotari

Search before reporting

  • I searched in the issues and found nothing similar.

Motivation

In Pulsar, there seems to be multiple code locations at least in the replicator implementation where there's a check whether the cursor has a backlog. The condition in some cases is cursor.getNumberOfEntriesInBacklog(true) > 0.

Solution

Instead of calculating the backlog count, it would be useful to have a simple check whether there's any backlog.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions