AndrewJSchofield commented on code in PR #17537:
URL: https://github.com/apache/kafka/pull/17537#discussion_r1818602360
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -1214,6 +1217,38 @@ Tuple<AcknowledgeRequestState> requestStates(int nodeId)
{
return acknowledgeRequestStates.get(nodeId);
}
+ static class IdAndPartition {
+ private final Uuid topicId;
+ private final int partitionIndex;
+
+ IdAndPartition(Uuid topicId, int partitionIndex) {
+ this.topicId = topicId;
+ this.partitionIndex = partitionIndex;
+ }
+
+ int getPartitionIndex() {
+ return partitionIndex;
+ }
+
+ Uuid getTopicId() {
+ return topicId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topicId, partitionIndex);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ IdAndPartition that = (IdAndPartition) o;
+ return Objects.equals(topicId, that.topicId) &&
+ Objects.equals(partitionIndex, that.partitionIndex);
Review Comment:
I'd prefer to see the primitive type just compared with `==`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]