[
https://issues.apache.org/jira/browse/SAMZA-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997393#comment-14997393
]
Tommy Becker commented on SAMZA-812:
------------------------------------
RB: https://reviews.apache.org/r/40106/
> CachedStore flushes too often
> -----------------------------
>
> Key: SAMZA-812
> URL: https://issues.apache.org/jira/browse/SAMZA-812
> Project: Samza
> Issue Type: Bug
> Components: kv
> Affects Versions: 0.10.0, 0.9.1
> Reporter: Tommy Becker
> Assignee: Tommy Becker
> Attachments:
> 0001-SAMZA-812-Only-flush-CachedStore-when-necessary.patch
>
>
> The CachedStore wrapper class flushes on every put or putAll that dirties the
> cache. This seems rooted in a misunderstanding of
> LinkedHashMap.removeEldestEntry. This method is called on every put() or
> putAll() to the map, and the implementation in CachedStore flushes the dirty
> entries without first checking if the cache is at capacity. Interestingly,
> fixing this issue reveals another in
> org.apache.samza.storage.kv.TestKeyValueStores#putAndGet. This test
> unintentionally relies on the inefficient behavior in CachedStore to handle
> array keys. Specifically, even though different array instances can never get
> cache hits due to pass-by-reference semantics in the cache, the existing
> flushing behavior causes the arrays to get prematurely written to the store
> which has pass-by-value semantics.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)