Skip to content

Optimizes event handling by collapsing queue#6128

Merged
keith-turner merged 4 commits intoapache:mainfrom
keith-turner:event-squisher
Feb 17, 2026
Merged

Optimizes event handling by collapsing queue#6128
keith-turner merged 4 commits intoapache:mainfrom
keith-turner:event-squisher

Conversation

@keith-turner
Copy link
Contributor

@keith-turner keith-turner commented Feb 14, 2026

Introduces a specialized queue that collapses internal manager events. For example if a table event and a tablet event for same table are queued then it will collapse down to only the table event. Does the same for data level events, those will cause all table and tablet events under that data level to collapse.

This will be useful for #6119, remote processes can collapse in their buffer before sending to the primary manager. Spun it out into its own change as it also useful on its own.

@keith-turner keith-turner added this to the 4.0.0 milestone Feb 14, 2026

List<Event> events;
if (allLevels) {
events = List.of(new Event());
Copy link
Contributor

Choose a reason for hiding this comment

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

Could make this empty list a constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 4e4e63a

Comment on lines 251 to 252
var ranges =
events.stream().map(Event::getExtent).map(KeyExtent::toMetaRange).toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

The TabletGroupWatcher in the Manager is now the central point of tablet management actions in the cluster. Do we want to use streams here? It's going to introduce a small amount of latency and garbage in one iteration, but a huge amount over the lifetime of the Manager process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the streams in 4e4e63a which avoided making two passes over the data and made it possible to add some checks for unexpected cases.

@keith-turner keith-turner merged commit d59f227 into apache:main Feb 17, 2026
8 checks passed
@keith-turner keith-turner deleted the event-squisher branch February 17, 2026 17:32
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