[
https://issues.apache.org/jira/browse/BEAM-1002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15949472#comment-15949472
]
Kenneth Knowles commented on BEAM-1002:
---------------------------------------
This is definitely something a {{ViewFn}} could help, though it may seem
heavyweight and/or expressed in the wrong place. Specifically, something like
this hypothetical syntax:
{code}
class MyViewFn extends ViewFn<Multimap<...>, MySideType> {
...
}
ParDo.of(myDoFn).withSideInput(sidePC.apply(View.as(new MyViewFn()))
{code}
The runner is advised to cache the {{MySideType}}. The unfortunate part of this
is that the {{DoFn}} did not make the decision to cache.
> Enable caching of side-input dependent computations
> ---------------------------------------------------
>
> Key: BEAM-1002
> URL: https://issues.apache.org/jira/browse/BEAM-1002
> Project: Beam
> Issue Type: New Feature
> Components: beam-model
> Reporter: Robert Bradshaw
> Assignee: Kenneth Knowles
>
> Sometimes the kind of computations one wants to perform in startBundle depend
> on side inputs (and, implicitly, the window). For example, one might want to
> initialize a (non-serializable) stateful object. In particular, this leads to
> users incorrectly (in the case of triggered or non-globally-windowed side
> inputs) memoizing this computation in the first processElement call.
> One option would be to fold this into a customizable ViewFn.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)