You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2026/08/18 11:14:00 UTC
[jira] [Created] (KAFKA-20958) Introduce internal accessor pattern to encapsulate cross-package APIs
Chia-Ping Tsai created KAFKA-20958:
--------------------------------------
Summary: Introduce internal accessor pattern to encapsulate cross-package APIs
Key: KAFKA-20958
URL: https://issues.apache.org/jira/browse/KAFKA-20958
Project: Kafka
Issue Type: Improvement
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
Currently, to allow cross-package instantiation or state access for internal Kafka components, we either:
# Leak internal classes (like Time) in public constructors.
# Expose properties as protected.
We should introduce the Internal Accessor / Factory Pattern (using package-private scopes and `@InterfaceAudience.Private` helper classes) to cleanly encapsulate these.
Subsequently, we will deprecate the leaked public constructors/methods to ensure we can remove them in 5.0.
related discussion:
https://lists.apache.org/thread/1kmyqody36dhnzj5ph858zsfpl4qhm7l
https://github.com/apache/kafka/pull/21337#discussion_r3574009798
--
This message was sent by Atlassian Jira
(v8.20.10#820010)