bbejeck commented on code in PR #23144:
URL: https://github.com/apache/kafka/pull/23144#discussion_r3771653578


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java:
##########
@@ -512,10 +512,17 @@ public synchronized byte[] putIfAbsent(final Bytes key,
 
     @Override
     public void putAll(final List<KeyValue<Bytes, byte[]>> entries) {
+        Objects.requireNonNull(entries, "entries cannot be null");
+        // Validate up front so a null key rejects the whole batch. An 
accessor may apply the entries
+        // one at a time, and failing part-way through would otherwise leave 
the batch half-applied.
+        for (final KeyValue<Bytes, byte[]> entry : entries) {
+            Objects.requireNonNull(entry, "entry cannot be null");
+            Objects.requireNonNull(entry.key, "key cannot be null");
+        }
+        validateStoreOpen();

Review Comment:
   yes it's new here,  It's used in 18 call sites, and every method added in 
the KIP-892/1035 work, so it's following the pattern established. 
   
   For contex  the original commit that added `validateStoreOpen()` added it to 
`get`, `put`, `range`, `all` etc. so we could argue it should have been added 
there?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to