ableegoldman commented on code in PR #16505:
URL: https://github.com/apache/kafka/pull/16505#discussion_r1722566000
##########
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:
Btw can you also rename the iterator's `open` field to `iteratorOpen` or
something that won't conflict with the `open` field of the outer class ie the
store itself? Also it probably doesn't need to be volatile, pretty sure
iterators are not supposed to be shared between threads
--
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]