-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert Split to record #21583
Convert Split to record #21583
Conversation
Previously Split.equals did not invoke ConnectorSplit.equals, so it maybe didn't matter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seeks ok, but would be good for other set of eyes to look at it
Since the records have generates equals and hashCode methods, we need to switch away from using Set<Split> in the scheduler implementation which seems incorrect anyway as it suggests that we want to remove duplicates but hashCode and equals are not part of the ConnectorSplit contract.
22eefd7
to
f6ad259
Compare
@@ -92,7 +92,7 @@ private enum State | |||
private final BooleanSupplier anySourceTaskBlocked; | |||
private final PartitionIdAllocator partitionIdAllocator; | |||
private final Map<InternalNode, RemoteTask> scheduledTasks; | |||
private final Set<Split> pendingSplits = new HashSet<>(); | |||
private final List<Split> pendingSplits = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the line below
splitAssignment.values().forEach(pendingSplits::remove); // AbstractSet.removeAll performs terribly here.
now that pendingSplits is a list, this will be List.remove
, which is a slow thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the removeAll
better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the records have generates equals and hashCode methods, we need to switch away from using Set in the scheduler implementation which seems incorrect anyway as it suggests that we want to remove duplicates but hashCode and equals are not part of the ConnectorSplit contract.
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: