You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Daniel Halperin (JIRA)" <ji...@apache.org> on 2017/04/03 17:11:41 UTC
[jira] [Commented] (BEAM-609) Add Interface around Evaluator
Caching
[ https://issues.apache.org/jira/browse/BEAM-609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953837#comment-15953837 ]
Daniel Halperin commented on BEAM-609:
--------------------------------------
[~tgroh] any update here?
Also, if this is just an internal implementation detail / refactoring maybe this could be a starter bug?
> Add Interface around Evaluator Caching
> --------------------------------------
>
> Key: BEAM-609
> URL: https://issues.apache.org/jira/browse/BEAM-609
> Project: Beam
> Issue Type: Improvement
> Components: runner-direct
> Reporter: Thomas Groh
> Assignee: Thomas Groh
> Priority: Minor
>
> The "acquire-use-release" pattern is relatively common throughout the TransformEvaluators ((Un)BoundedRead, TestStream), and as a result there's some code duplication.
> Refactoring to use a common interface (among the lines of:
> public static class ConcurrentSingleUseInstanceCache<K, V> {
> public ConcurrentSingleUseInstanceCache(Function<K, V> createInstance) { ... }
> public @Nullable V tryAcquire(K key) { ... };
> public void release(K key, V value) { ... }
> }
> )
> would improve this abstraction boundary and get rid of some duplicate logic. We can also test the cache-and-hold implementations more easily.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)