Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class AbstractStickyAssignor extends AbstractPartitionAssignor {

public static final int DEFAULT_GENERATION = -1;

private PartitionMovements partitionMovements = new PartitionMovements();
private PartitionMovements partitionMovements;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we still initialize it here as well? I remember that was necessary for some tests to pass since they might never get to the generalAssign method and isSticky would hit NPE

On the other hand, it seems like isSticky is pointless to call unless we get to the generalAssign method. So maybe we should just remove that from the tests that only do the constrainedAssign and just verify the stickiness directly?


// Keep track of the partitions being migrated from one consumer to another during assignment
// so the cooperative assignor can adjust the assignment
Expand Down Expand Up @@ -272,6 +272,7 @@ private Map<String, List<TopicPartition>> generalAssign(Map<String, Integer> par
Map<String, Subscription> subscriptions) {
Map<String, List<TopicPartition>> currentAssignment = new HashMap<>();
Map<TopicPartition, ConsumerGenerationPair> prevAssignment = new HashMap<>();
partitionMovements = new PartitionMovements();

prepopulateCurrentAssignments(subscriptions, currentAssignment, prevAssignment);
boolean isFreshAssignment = currentAssignment.isEmpty();
Expand Down