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

A. Sophie Blee-Goldman commented on KAFKA-16458:
------------------------------------------------

This could be nice to have, but unfortunately given the overly complex way that 
state stores are implemented and the multi-layer hierarchy, something that 
should be simple – ie just adding a basic API to the StateStore interface – 
actually ends up being a massive amount of work.

We do plan to overhaul the state store hierarchy at some point in order to 
simplify the codebase, both for maintenance and new features, although there's 
no clear roadmap or promise for this to happen anytime soon. That said, I would 
personally suggest we hold off on adding any new APIs that don't add 
strictly-new functionality until after we've simplified the state store 
implementation. 

Of course, if this is something you really want, you're always free to kick off 
a KIP discussion whenever. Just wanted to provide some context and warn that 
this would not be as straightforward as it might seem to actually implement.

To your final question: I do think in some sense the reality is that yes, this 
API is not offered on purpose, in order to keep the interface as simple as 
possible. But this in itself would be less of a concern if the state store 
hierarchy was not such a hassle to expand and maintain, which is why I think 
the community would be open to it after we can get around to cleaning up the 
store implementation.

> Add contains method in KeyValue store interface
> -----------------------------------------------
>
>                 Key: KAFKA-16458
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16458
>             Project: Kafka
>          Issue Type: Wish
>          Components: streams
>            Reporter: Ayoub Omari
>            Priority: Minor
>              Labels: needs-kip
>
> In some stream processors, we sometimes just want to check if a key exists in 
> the state store or not.
>  
> I find calling .get() and checking if the return value is null a little bit 
> verbose
> {code:java}
> if (store.get(key) != null) {
> }{code}
>  
> But I am not sure if it is on purpose that we would like to keep the store 
> interface simple.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to