You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "JimmyWang6 (via GitHub)" <gi...@apache.org> on 2025/10/31 07:01:40 UTC
[PR] MINOR: Use explicit AcknowledgeType enums in SharePartitionTest tests [kafka]
JimmyWang6 opened a new pull request, #20802:
URL: https://github.com/apache/kafka/pull/20802
This PR updates the `SharePartitionTest.java` unit tests to use `AcknowledgeType` enums instead of hardcoded byte values. This makes the tests more readable and maintainable, and ensures that acknowledgement types are referenced consistently throughout the codebase.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Use explicit AcknowledgeType enums in SharePartitionTest [kafka]
Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield merged PR #20802:
URL: https://github.com/apache/kafka/pull/20802
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Use explicit AcknowledgeType enums in SharePartitionTest [kafka]
Posted by "JimmyWang6 (via GitHub)" <gi...@apache.org>.
JimmyWang6 commented on code in PR #20802:
URL: https://github.com/apache/kafka/pull/20802#discussion_r2483090819
##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -6382,9 +6382,9 @@ public void testLsoMovementPostGapsInAcknowledgements() {
fetchAcquiredRecords(sharePartition, records2, 9);
sharePartition.acknowledge(MEMBER_ID, List.of(
- new ShareAcknowledgementBatch(5, 6, List.of((byte) 2)),
+ new ShareAcknowledgementBatch(5, 6, List.of(AcknowledgeType.RELEASE.id)),
new ShareAcknowledgementBatch(10, 18, List.of(
- (byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 0, (byte) 0, (byte) 0, (byte) 2
+ AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, AcknowledgeType.RELEASE.id
Review Comment:
Thanks for comment, done.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Use explicit AcknowledgeType enums in SharePartitionTest tests [kafka]
Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield commented on code in PR #20802:
URL: https://github.com/apache/kafka/pull/20802#discussion_r2482275674
##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -6382,9 +6382,9 @@ public void testLsoMovementPostGapsInAcknowledgements() {
fetchAcquiredRecords(sharePartition, records2, 9);
sharePartition.acknowledge(MEMBER_ID, List.of(
- new ShareAcknowledgementBatch(5, 6, List.of((byte) 2)),
+ new ShareAcknowledgementBatch(5, 6, List.of(AcknowledgeType.RELEASE.id)),
new ShareAcknowledgementBatch(10, 18, List.of(
- (byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 0, (byte) 0, (byte) 0, (byte) 2
+ AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, AcknowledgeType.RELEASE.id
Review Comment:
Break the line now it's so long?
##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -2820,7 +2820,7 @@ public void testAcknowledgeOutOfRangeCachedData() {
ackResult = sharePartition.acknowledge(
MEMBER_ID,
- List.of(new ShareAcknowledgementBatch(20, 25, List.of((byte) 3))));
+ List.of(new ShareAcknowledgementBatch(20, 25, List.of(AcknowledgeType.RELEASE.id))));
Review Comment:
3 is REJECT :)
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Use explicit AcknowledgeType enums in SharePartitionTest [kafka]
Posted by "JimmyWang6 (via GitHub)" <gi...@apache.org>.
JimmyWang6 commented on code in PR #20802:
URL: https://github.com/apache/kafka/pull/20802#discussion_r2483090652
##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -2820,7 +2820,7 @@ public void testAcknowledgeOutOfRangeCachedData() {
ackResult = sharePartition.acknowledge(
MEMBER_ID,
- List.of(new ShareAcknowledgementBatch(20, 25, List.of((byte) 3))));
+ List.of(new ShareAcknowledgementBatch(20, 25, List.of(AcknowledgeType.RELEASE.id))));
Review Comment:
Good catch! Done.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org