chia7712 commented on code in PR #16291:
URL: https://github.com/apache/kafka/pull/16291#discussion_r1635503418
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -1078,14 +1083,10 @@ private void chainFuture(
}
@Override
- public String toString() {
- return "OffsetFetchRequestState{" +
- "requestedPartitions=" + requestedPartitions +
- ", memberId=" + memberInfo.memberId.orElse("undefined") +
- ", memberEpoch=" + (memberInfo.memberEpoch.isPresent() ?
memberInfo.memberEpoch.get() : "undefined") +
- ", future=" + future +
- ", " + toStringBase() +
- '}';
+ public String toStringBase() {
+ return super.toStringBase() +
+ ", requestedPartitions=" + requestedPartitions +
+ ", future=" + future;
Review Comment:
not sure whether it is worth printing `future` since it show reference
address only :(
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java:
##########
@@ -122,6 +123,48 @@ public void setup() {
this.props.put(VALUE_DESERIALIZER_CLASS_CONFIG,
StringDeserializer.class);
}
+ @Test
+ public void testOffsetFetchRequestStateToStringBase() {
+ ConsumerConfig config = mock(ConsumerConfig.class);
+ CommitRequestManager.MemberInfo memberInfo = new
CommitRequestManager.MemberInfo();
Review Comment:
As we had discussion about "Optional#toString", maybe we define either
`MemberInfo#memberId` or `MemberInfo#memberEpoch`, and then we should check the
`MemberInfo#toString` does not contain "Optional[value]"
--
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]