Skip to content

[CASSANDRA-21645][trunk] Use MpscUnboundedArrayQueue in native transport flusher - #5189

Open
netudima wants to merge 1 commit into
apache:trunkfrom
netudima:CASSANDRA-21645-trunk
Open

netudima wants to merge 1 commit into
apache:trunkfrom
netudima:CASSANDRA-21645-trunk

Conversation

@netudima

Copy link
Copy Markdown
Contributor

patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-21645

patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-21645
protected final EventLoop eventLoop;
private final ConcurrentLinkedQueue<FlushItem<?>> queued = new ConcurrentLinkedQueue<>();
// Many request threads produce, but only the event loop this flusher belongs to consumes, so an MPSC queue is enough.
private final MpscUnboundedArrayQueue<FlushItem<?>> queued = new MpscUnboundedArrayQueue<>(256);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poll can spin now potentially, and it will do so in the event loop. We could relax the poll by calling queued.relaxedPoll() instead in the org.apache.cassandra.transport.Flusher#poll method to be on the safe side.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe we can ground the initialization value here based on something .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants