You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by John Brackin <jb...@gmail.com> on 2023/12/18 12:46:11 UTC

Question about using public classes from the internal packages

Hi all,

I have a question about using classes that are are public but the class is
contained in the internals packages  Generally, would it be supported if I
wrote Kafka code referencing these classes?

This question comes from an attempt to add a CacheListener to a
TimestampedKeyValueStore.  The line of code looks like this:

    cachingEnabled = ((WrappedStateStore) this.store).setFlushListener(new
AggregateCacheFlushListener<>(context), false);

To gain access to the setFlushListener the code needs to cast the
underlying state store object to a
org.apache.kafka.streams.state.internals.WrappedStateStore object.

Kind regards,
John Brackin

Re: Question about using public classes from the internal packages

Posted by Vikram Singh <vi...@clouzersolutions.com.INVALID>.
?????????

On Wed, Dec 20, 2023 at 6:00 PM Vikram Singh <
vikram.singh@clouzersolutions.com> wrote:

> Hello Team,
> I have done setup of 3 node kafka cluster(3.4.1) all nodes within cluster
> are configured as broker and controller due to some reasons i have
> restarted kafka cluster. but after restarting kafka cluster nodes are not
> getting in the same cluster. Can you please help me out with this issue?
>
> On Tue, Dec 19, 2023 at 10:00 PM Bruno Cadonna <ca...@apache.org> wrote:
>
>> Hi John,
>>
>> In general, we do not guarantee anything on APIs of the internal
>> package. That is also the reason why you do not need a KIP to change
>> those classes. Any class for which the build generates Javadoc is
>> considered public API [1]. For public APIs we guarantee backwards
>> compatibility.
>>
>> Best,
>> Bruno
>>
>> [1]
>>
>> https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals
>>
>> On 12/18/23 1:46 PM, John Brackin wrote:
>> > Hi all,
>> >
>> > I have a question about using classes that are are public but the class
>> is
>> > contained in the internals packages  Generally, would it be supported
>> if I
>> > wrote Kafka code referencing these classes?
>> >
>> > This question comes from an attempt to add a CacheListener to a
>> > TimestampedKeyValueStore.  The line of code looks like this:
>> >
>> >      cachingEnabled = ((WrappedStateStore)
>> this.store).setFlushListener(new
>> > AggregateCacheFlushListener<>(context), false);
>> >
>> > To gain access to the setFlushListener the code needs to cast the
>> > underlying state store object to a
>> > org.apache.kafka.streams.state.internals.WrappedStateStore object.
>> >
>> > Kind regards,
>> > John Brackin
>> >
>>
>
>
> --
> Thanks & Regards
> *VIKRAM S SINGH*
>


-- 
Thanks & Regards
*VIKRAM S SINGH*

Re: Question about using public classes from the internal packages

Posted by Vikram Singh <vi...@clouzersolutions.com.INVALID>.
Hello Team,
I have done setup of 3 node kafka cluster(3.4.1) all nodes within cluster
are configured as broker and controller due to some reasons i have
restarted kafka cluster. but after restarting kafka cluster nodes are not
getting in the same cluster. Can you please help me out with this issue?

On Tue, Dec 19, 2023 at 10:00 PM Bruno Cadonna <ca...@apache.org> wrote:

> Hi John,
>
> In general, we do not guarantee anything on APIs of the internal
> package. That is also the reason why you do not need a KIP to change
> those classes. Any class for which the build generates Javadoc is
> considered public API [1]. For public APIs we guarantee backwards
> compatibility.
>
> Best,
> Bruno
>
> [1]
>
> https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals
>
> On 12/18/23 1:46 PM, John Brackin wrote:
> > Hi all,
> >
> > I have a question about using classes that are are public but the class
> is
> > contained in the internals packages  Generally, would it be supported if
> I
> > wrote Kafka code referencing these classes?
> >
> > This question comes from an attempt to add a CacheListener to a
> > TimestampedKeyValueStore.  The line of code looks like this:
> >
> >      cachingEnabled = ((WrappedStateStore)
> this.store).setFlushListener(new
> > AggregateCacheFlushListener<>(context), false);
> >
> > To gain access to the setFlushListener the code needs to cast the
> > underlying state store object to a
> > org.apache.kafka.streams.state.internals.WrappedStateStore object.
> >
> > Kind regards,
> > John Brackin
> >
>


-- 
Thanks & Regards
*VIKRAM S SINGH*

Re: Question about using public classes from the internal packages

Posted by Bruno Cadonna <ca...@apache.org>.
Hi John,

In general, we do not guarantee anything on APIs of the internal 
package. That is also the reason why you do not need a KIP to change 
those classes. Any class for which the build generates Javadoc is 
considered public API [1]. For public APIs we guarantee backwards 
compatibility.

Best,
Bruno

[1] 
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals

On 12/18/23 1:46 PM, John Brackin wrote:
> Hi all,
> 
> I have a question about using classes that are are public but the class is
> contained in the internals packages  Generally, would it be supported if I
> wrote Kafka code referencing these classes?
> 
> This question comes from an attempt to add a CacheListener to a
> TimestampedKeyValueStore.  The line of code looks like this:
> 
>      cachingEnabled = ((WrappedStateStore) this.store).setFlushListener(new
> AggregateCacheFlushListener<>(context), false);
> 
> To gain access to the setFlushListener the code needs to cast the
> underlying state store object to a
> org.apache.kafka.streams.state.internals.WrappedStateStore object.
> 
> Kind regards,
> John Brackin
>