Skip to content

KAFKA-20297: Move AbstractIterator, CircularIterator, CloseableIterator... into internal#22052

Merged
FrankYang0529 merged 2 commits intoapache:trunkfrom
m1a2st:move-some-class-into-internal
Apr 15, 2026
Merged

KAFKA-20297: Move AbstractIterator, CircularIterator, CloseableIterator... into internal#22052
FrankYang0529 merged 2 commits intoapache:trunkfrom
m1a2st:move-some-class-into-internal

Conversation

@m1a2st
Copy link
Copy Markdown
Collaborator

@m1a2st m1a2st commented Apr 14, 2026

We have exposed several classes in org.apache.kafka.common.utils as
public APIs, which can be misleading since not all classes in this
package are intended for external use.

To clarify API boundaries and prevent unintended usage, we propose
moving the following classes to an internal package:

  • AbstractIterator
  • CircularIterator
  • CloseableIterator
  • CopyOnWriteMap
  • FixedOrderMap
  • PrimitiveRef

Reviewers: Christo lolovc@amazon.com, PoAn Yang payang@apache.org

@github-actions github-actions bot added triage PRs from the community streams producer consumer connect performance storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature build Gradle build or GitHub Actions clients labels Apr 14, 2026
@m1a2st m1a2st changed the title MINOR: Move AbstractIterator, CircularIterator, CloseableIterator, CopyOnWriteMap, FixedOrderMap, PrimitiveRef into internal package MINOR: Move AbstractIterator, CircularIterator, CloseableIterator... into internal Apr 14, 2026
Copy link
Copy Markdown
Contributor

@nileshkumar3 nileshkumar3 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! A couple of items:

Missed file

TransactionIndex.java still imports org.apache.kafka.common.utils.PrimitiveRef and is not updated by this PR. This will break compilation in the storage module.

Typo: The commit message says "move to interanl"

@clolov
Copy link
Copy Markdown
Contributor

clolov commented Apr 14, 2026

Missed file
TransactionIndex.java still imports org.apache.kafka.common.utils.PrimitiveRef and is not updated by this PR. This will break compilation in the storage module.

On a quick check, I do not see what you are referring to here. Could you elaborate?

Copy link
Copy Markdown
Contributor

@clolov clolov left a comment

Choose a reason for hiding this comment

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

In general this looks good. Is it possible for you to add a bit more information behind this change in the PR description especially given that it doesn't have a JIRA associated with it?

Ah, I was just reviewing another PR linked to KAFKA-20297, I guess that's the one you are targeting?

@m1a2st m1a2st changed the title MINOR: Move AbstractIterator, CircularIterator, CloseableIterator... into internal KAFKA-20297: Move AbstractIterator, CircularIterator, CloseableIterator... into internal Apr 14, 2026
@m1a2st
Copy link
Copy Markdown
Collaborator Author

m1a2st commented Apr 14, 2026

@clolov Thanks for your review. I originally thought this was a minor patch, but I found that there is already a Jira tracking this issue, so I’ve updated the title and description accordingly.

@nileshkumar3
Copy link
Copy Markdown
Contributor

ransactionIndex.java still imports org.apache.kafka.common.utils.PrimitiveRef and is not updated by this PR. This will break compilation in the storage module.

On a quick check, I do not see what you are referring to here. Could you elaborate?

you're right, my mistake. I double checked , it's not an issue. sorry for the noise.

# Conflicts:
#	clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
#	storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java
@github-actions github-actions bot removed the triage PRs from the community label Apr 15, 2026
@chia7712
Copy link
Copy Markdown
Member

@nileshkumar3 the comment seems completely out of context and feels like it was generated by an AI without understanding the actual technical depth of this thread. Out of curiosity, are you a real person, or just using an automated bot?

@nileshkumar3
Copy link
Copy Markdown
Contributor

@nileshkumar3 the comment seems completely out of context and feels like it was generated by an AI without understanding the actual technical depth of this thread. Out of curiosity, are you a real person, or just using an automated bot?

@chia7712 I am real and this is not out of context. I was on an outdated branch when reviewing this. this file was recently changed. #21577 previously it was using that import.

@FrankYang0529 FrankYang0529 merged commit 2299a06 into apache:trunk Apr 15, 2026
23 checks passed
@mingyen066
Copy link
Copy Markdown
Collaborator

@nileshkumar3 Genuinely curious—how did you find PrimitiveRef import is not updated? Manually checking every renamed file on an outdated branch seems impractical for a human. Did you use some tool/script?

@nileshkumar3
Copy link
Copy Markdown
Contributor

@nileshkumar3 Genuinely curious—how did you find PrimitiveRef import is not updated? Manually checking every renamed file on an outdated branch seems impractical for a human. Did you use some tool/script?

no tool or script, i just use simple text search in intellij. search for import org.apache.kafka.common.utils.PrimitiveRef or import org.apache.kafka.common.utils./**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions clients connect consumer performance producer storage Pull requests that target the storage module streams tiered-storage Related to the Tiered Storage feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants