Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e8d3607
Server Side Sticky Range Assignor full implementation
rreddy-22 Mar 23, 2023
3df3460
removed reduce partitions case
rreddy-22 Mar 28, 2023
7410529
removed reduce partitions case
rreddy-22 Mar 28, 2023
3b6e65e
Addressed PR comments
rreddy-22 Mar 29, 2023
4b321aa
Addressed PR comments
rreddy-22 Apr 3, 2023
b4041a7
Merge branch 'apache:trunk' into rreddy-22/KAFKA-14514
rreddy-22 Apr 6, 2023
7352cbb
minor
rreddy-22 Apr 6, 2023
57b94ca
Made subscribed topics a collection, removed * import exception
rreddy-22 Apr 6, 2023
5065109
Interface changes for assignment map and subscribed topics, added new…
rreddy-22 Apr 6, 2023
100a04e
Added toString method and hash
rreddy-22 Apr 7, 2023
73c7fdc
Made all attributes private and added getter methods, changed names a…
rreddy-22 Apr 11, 2023
68d53b3
Removed topicIdToPartition class, changed attribute names and added j…
rreddy-22 Apr 12, 2023
48a9822
Server Side Sticky Range Assignor full implementation
rreddy-22 Mar 23, 2023
dcb8198
removed reduce partitions case
rreddy-22 Mar 28, 2023
9f3a423
removed reduce partitions case
rreddy-22 Mar 28, 2023
a925b02
Addressed PR comments
rreddy-22 Mar 29, 2023
7d16269
Addressed PR comments
rreddy-22 Apr 3, 2023
7369db3
minor
rreddy-22 Apr 6, 2023
918d262
Made subscribed topics a collection, removed * import exception
rreddy-22 Apr 6, 2023
288fa1f
Addressed some PR comments
rreddy-22 Apr 12, 2023
a1bdb58
Removed putList, putSet, changed generic pair to remainingAssignments…
rreddy-22 Apr 13, 2023
0737c8d
Merge remote-tracking branch 'origin/rreddy-22/KAFKA-14514' into rred…
rreddy-22 Apr 17, 2023
3d92645
Interface changes incorporated, added stickiness test and non-existen…
rreddy-22 Apr 17, 2023
309cc61
Merge branch 'trunk' into rreddy-22/KAFKA-14514
rreddy-22 Apr 17, 2023
27a86d8
addressed some PR comments
rreddy-22 Apr 19, 2023
6ced281
addressed PR comments
rreddy-22 Apr 19, 2023
6aeccd6
fixed formatting stuff that was mentioned in PR comments
rreddy-22 Apr 20, 2023
faeda40
Fixed formatting and added mkAssignment function
rreddy-22 Apr 20, 2023
bbbf930
Made remaining formatting changes to the range assignor code
rreddy-22 Apr 21, 2023
0d6d127
moved getUnassignedPartitions and assign unfilled members into the sa…
rreddy-22 Apr 25, 2023
e90a8c4
Merge branch 'trunk' into rreddy-22/KAFKA-14514
rreddy-22 Apr 25, 2023
852be6b
suppression removed
rreddy-22 Apr 25, 2023
6706681
Merge remote-tracking branch 'origin/rreddy-22/KAFKA-14514' into rred…
rreddy-22 Apr 25, 2023
0a3dc7c
suppression removed
rreddy-22 Apr 25, 2023
0823f2a
added another test to check if stickiness is retained with the extra …
rreddy-22 Apr 26, 2023
91f9417
nit
rreddy-22 Apr 26, 2023
078cb9f
indentation fixes
rreddy-22 Apr 27, 2023
9553b10
Range assignor main file changes
rreddy-22 Apr 27, 2023
bfcb897
Range assignor test file changes
rreddy-22 Apr 27, 2023
f3e72e5
Range assignor test file changes
rreddy-22 May 9, 2023
56863d8
not using code for variable names in java doc
rreddy-22 May 9, 2023
4a3ad5f
changed code
rreddy-22 May 9, 2023
85766ce
minor
rreddy-22 May 9, 2023
9bcaf34
minor
rreddy-22 May 9, 2023
edbf227
html formatting changes and other small things
rreddy-22 May 9, 2023
62470e8
Test formatting changes
rreddy-22 May 9, 2023
9c9afd8
addressed whatever was left
rreddy-22 May 10, 2023
54ca849
small fixes and cosmetic changes
dajac May 10, 2023
b6de541
Merge remote-tracking branch 'upstream/trunk' into rreddy-22-rreddy-2…
dajac May 10, 2023
73dead3
fix compilation
dajac May 10, 2023
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
8 changes: 8 additions & 0 deletions checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@
<suppress checks="AvoidStarImport"
files="MetadataVersionTest.java"/>

<!-- group coordinator -->
<suppress checks="CyclomaticComplexity"
files="ServerSideStickyRangeAssignor.java"/>
<suppress checks="NPathComplexity"
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated
files="ServerSideStickyRangeAssignor.java"/>
<suppress checks="AvoidStarImport"
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated
files="ServerSideStickyRangeAssignorTest.java"/>

<!-- storage -->
<suppress checks="CyclomaticComplexity"
files="(LogValidator|RemoteLogManagerConfig).java"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
*/
package org.apache.kafka.coordinator.group.assignor;

import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.Uuid;

import java.util.Collection;
import java.util.Objects;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Optional;
import java.util.Objects;

/**
* The assignment specification for a consumer group member.
Expand All @@ -37,29 +39,28 @@ public class AssignmentMemberSpec {
final Optional<String> rackId;

/**
* The topics that the member is subscribed to.
* The topicIds of topics that the member is subscribed to.
*/
final Collection<String> subscribedTopics;
final List<Uuid> subscribedTopics;
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated

/**
* The current target partitions of the member.
* Maps the partitions assigned for this member per topicId
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated
*/
final Collection<TopicPartition> targetPartitions;
final Map<Uuid, Set<Integer>> currentAssignmentPerTopic;

public AssignmentMemberSpec(
Optional<String> instanceId,
Optional<String> rackId,
Collection<String> subscribedTopics,
Collection<TopicPartition> targetPartitions
List<Uuid> subscribedTopics,
Map<Uuid, Set<Integer>> currentAssignmentPerTopic
) {
Objects.requireNonNull(instanceId);
Objects.requireNonNull(rackId);
Objects.requireNonNull(subscribedTopics);
Objects.requireNonNull(targetPartitions);
this.instanceId = instanceId;
this.rackId = rackId;
this.subscribedTopics = subscribedTopics;
this.targetPartitions = targetPartitions;
this.currentAssignmentPerTopic = currentAssignmentPerTopic;
}

@Override
Expand All @@ -72,15 +73,15 @@ public boolean equals(Object o) {
if (!instanceId.equals(that.instanceId)) return false;
if (!rackId.equals(that.rackId)) return false;
if (!subscribedTopics.equals(that.subscribedTopics)) return false;
return targetPartitions.equals(that.targetPartitions);
return currentAssignmentPerTopic.equals(that.currentAssignmentPerTopic);
}

@Override
public int hashCode() {
int result = instanceId.hashCode();
result = 31 * result + rackId.hashCode();
result = 31 * result + subscribedTopics.hashCode();
result = 31 * result + targetPartitions.hashCode();
result = 31 * result + currentAssignmentPerTopic.hashCode();
return result;
}

Expand All @@ -89,7 +90,7 @@ public String toString() {
return "AssignmentMemberSpec(instanceId=" + instanceId +
", rackId=" + rackId +
", subscribedTopics=" + subscribedTopics +
", targetPartitions=" + targetPartitions +
", currentAssignment=" + currentAssignmentPerTopic +
')';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public GroupAssignment(
this.members = members;
}

public Map<String, MemberAssignment> getMembers() {
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated
return this.members;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,28 @@
*/
package org.apache.kafka.coordinator.group.assignor;

import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.Uuid;

import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.Set;


/**
* The partition assignment for a consumer group member.
*/
public class MemberAssignment {
/**
* The target partitions assigned to this member.
*/
final Collection<TopicPartition> targetPartitions;

public MemberAssignment(
Collection<TopicPartition> targetPartitions
) {
Objects.requireNonNull(targetPartitions);
this.targetPartitions = targetPartitions;

private final Map<Uuid, Set<Integer>> assignmentPerTopic;


public MemberAssignment(Map<Uuid, Set<Integer>> assignmentPerTopic) {
Objects.requireNonNull(assignmentPerTopic);
this.assignmentPerTopic = assignmentPerTopic;
}

public Map<Uuid, Set<Integer>> getAssignmentPerTopic() {
Comment thread
rreddy-22 marked this conversation as resolved.
Outdated
return this.assignmentPerTopic;
}

@Override
Expand All @@ -44,16 +47,16 @@ public boolean equals(Object o) {

MemberAssignment that = (MemberAssignment) o;

return targetPartitions.equals(that.targetPartitions);
return assignmentPerTopic.equals(that.assignmentPerTopic);
}

@Override
public int hashCode() {
return targetPartitions.hashCode();
return assignmentPerTopic.hashCode();
}

@Override
public String toString() {
return "MemberAssignment(targetPartitions=" + targetPartitions + ')';
return "MemberAssignment(targetPartitions=" + assignmentPerTopic + ')';
}
}
Loading