ableegoldman commented on code in PR #16505:
URL: https://github.com/apache/kafka/pull/16505#discussion_r1722564483
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/InMemoryKeyValueStore.java:
##########
@@ -265,23 +264,45 @@ private InMemoryKeyValueIterator(final Set<Bytes> keySet,
final boolean forward)
@Override
public boolean hasNext() {
- return iter.hasNext();
+ if (!open) {
+ throw new InvalidStateStoreException(String.format("Store %s
has closed", name));
Review Comment:
Interesting, I'd say that's probably a bug in the
`DelegatingPeekingKeyValueIterator` error message then.
I certainly doesn't hurt to throw an exception if the iterator is used after
being closed, though I wonder if `InvalidStateStoreException` really makes
sense here. Imo we should update both the error message and the exception type.
I'd say just a simple IllegalStateException would fit here
Can you make this change both for the new iterator here and for the
`DelegatingPeekingKeyValueIterator`?
--
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]