[
https://issues.apache.org/jira/browse/KAFKA-6487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341404#comment-16341404
]
James Cheng commented on KAFKA-6487:
------------------------------------
While waiting for a fix, a workaround would be to skip any entries that come
back from the iterator, that have null as a value.
This would only work, though, if you never expected that null would be a valid
value in your use case
{code:java}
try (KeyValueIterator<String, String> iter = stateStore.all()) {
while (iter.hasNext()) {
KeyValue<String, String> keyValue = iter.next();
if (keyValue.value == null) {
// skip
} else {
// do something
}
}
}
{code}
> ChangeLoggingKeyValueBytesStore.all() returns null
> --------------------------------------------------
>
> Key: KAFKA-6487
> URL: https://issues.apache.org/jira/browse/KAFKA-6487
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Bill Bejeck
> Assignee: Bill Bejeck
> Priority: Major
>
> The {{ChangeLoggingKeyValueBytesStore}} implements the {{KeyValueStore}}
> interface which extends the {{ReadOnlyKeyValueStore}} interface. The Javadoc
> for {{ReadOnlyKeyValueStore#all}} states the method should never return a
> {{null}} value.
> But when deleting a record from the {{ChangeLoggingKeyValueBytesStore}} and
> subsequently calling the {{all}} method, a null value is returned.
>
> https://issues.apache.org/jira/browse/KAFKA-4750 is a related issue
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)