Cameron Lee created SAMZA-2564:
----------------------------------
Summary: InMemoryKeyValueStore.snapshot does not satisfy
immutability API
Key: SAMZA-2564
URL: https://issues.apache.org/jira/browse/SAMZA-2564
Project: Samza
Issue Type: Bug
Reporter: Cameron Lee
The return value of KeyValueStore.snapshot is only supposed to reflect the
state of the store when "snapshot" was called. Part of the Javadoc says "The
snapshot is immutable - ie., any mutations to the store are not reflected in
the snapshot after it is created." However, the implementation of
InMemoryKeyValueStore.snapshot does not satisfy this requirement, since the
return value of InMemoryKeyValueStore.snapshot does reflect changes to the
store.
It might work to create a copy of the entrySet of the subMap in
InMemoryKeyValueStore.snapshot so that its iterator is not backed by the
underlying map. However, this needs to be tested, and it will likely increase
memory usage.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)