Re: Is it safe to cache the value of a singleton view (with a global window) in a DoFn?

2019-05-07 Thread Lukasz Cwik
Keep your code simple and rely on the runner caching the value locally so it should be very cheap to access. If you have a performance issue due to a runner lacking caching, it would be good to hear about it so we could file a JIRA about it. On Mon, May 6, 2019 at 4:24 PM Kenneth Knowles wrote:

Re: Is it safe to cache the value of a singleton view (with a global window) in a DoFn?

2019-05-06 Thread Kenneth Knowles
A singleton view in the global window and no triggering does have just a single immutable value. (It really ought to have an updated value in the presence of triggers, but I believe instead you will receive a crash. I haven't tested.) In general, a side input yields one value per window. Dataflow

Is it safe to cache the value of a singleton view (with a global window) in a DoFn?

2019-05-04 Thread Steve Niemitz
I have a singleton view in a global window that is read from a DoFn. I'm curious if its "correct" to cache that value from the view, or if I need to read it every time. As a (simplified) example, if I were to generate the view as such: input.getPipeline