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

Almog Gavra commented on KAFKA-16458:
-------------------------------------

A big win for this would be the ability to avoid de-serializing values if the 
values are large in situations where we just need to check "contains". To 
mitigate the hierarchy problem there could be a default implementation for it 
that just issues a `get != null`.

> 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