[ 
https://issues.apache.org/jira/browse/KAFKA-8828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16916251#comment-16916251
 ] 

Adam Rinehart commented on KAFKA-8828:
--------------------------------------

This issue just happened to me. 

I am using the DSL. I created a GlobalKTable and then started creating my 
streams. One of the streams was a flatTransformation that uses the global store 
that was created as part of the creation of the GlobalKTable to check for 
existing records to delete. When creating the TransformerSupplier/Transformer, 
I passed in the globalKTable.queryableStoreName(). In the transformer 
initializer, I used the processContext to call KeyValueStore<String, 
MyValueObject> keyValueStore = (KeyValueStore<String, MyValueObject>) 
processorContext.getStateStore( storeName ); // get the global store

When I attempted to access the KeyValue.value field, I got class cast 
exceptions, and found out that it was changed to a TimestampedKeyValueStore; 
much of the existing documentation is not current to this change.

I'm relatively new to kafka so I'm not sure how to get a reference to the 
stream itself within the transformer; if I could, I could have done localStore 
= streams.store( storeName, QueryableStoreTypes.keyValueStore() );

 

> [BC Break] Global store returns a TimestampedKeyValueStore in 2.3
> -----------------------------------------------------------------
>
>                 Key: KAFKA-8828
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8828
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.3.0
>            Reporter: Marcos Passos
>            Priority: Major
>
> Since 2.3, {{ProcessorContext}} returns a {{TimestampedKeyValueStore}} for 
> global stores, which is backward incompatible. This change makes the upgrade 
> path a lot painful and involves creating a non-trivial adapter to hide the 
> timestamp-related functionality in cases where it is not needed.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to