mjsax commented on a change in pull request #10548:
URL: https://github.com/apache/kafka/pull/10548#discussion_r615007673



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java
##########
@@ -326,6 +326,7 @@ public void putAll(final List<KeyValue<Bytes, byte[]>> 
entries) {
 
     @Override
     public synchronized byte[] get(final Bytes key) {
+        Objects.requireNonNull(key, "key cannot be null");

Review comment:
       I think we should add this to `MeteredKeyValueStore` instead -- this 
way, we get the same guard for the in-memory key-value store (or other custom 
stores).
   
   We should also add this check to other methods that accept a key, like 
`put`, `putIfAbsent` etc...
   
   Furthermore, we should also add it for other store types, ie, 
`MeteredTimestampedKeyValueStore`, `MeteredWindowedStore`, 
`MeteredTimestampedWindowStore` and `MeteredSessionStore`.
   
   Last, but not least, we should add corresponding unit tests.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to