[jira] [Commented] (BEAM-1335) ValueState could use an initial/default value

2017-02-02 Thread Aljoscha Krettek (JIRA)

[ 
https://issues.apache.org/jira/browse/BEAM-1335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15850086#comment-15850086
 ] 

Aljoscha Krettek commented on BEAM-1335:


No, only the internal implementation is harder to get right. (One of the 
difficulties is that Flink doesn't just have a {{Coder}} but a 
{{TypeInformation}} that can be asked to give a {{TypeSerializer}}, where the 
latter is similar to a {{Coder}}. The {{TypeSeriailzer}} that is returned can 
depend on pipeline-level configuration settings so it's hard to get that always 
working correctly because of serialisation of the user function, where you also 
have to serialise the state spec.)

Since we tend to put ease of use before ease of internal development I think 
it's good to have this option, also since {{Coders}} are easier to deal with.

> ValueState could use an initial/default value
> -
>
> Key: BEAM-1335
> URL: https://issues.apache.org/jira/browse/BEAM-1335
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Reporter: Kenneth Knowles
>Priority: Minor
>  Labels: starter
>
> In writing example state code with {{ValueState}} there is almost always a 
> use of {{firstNonNull(state.read(), defaultValue)}}. It would be nice to bake 
> this into the declaration.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (BEAM-1335) ValueState could use an initial/default value

2017-01-31 Thread Kenneth Knowles (JIRA)

[ 
https://issues.apache.org/jira/browse/BEAM-1335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15847921#comment-15847921
 ] 

Kenneth Knowles commented on BEAM-1335:
---

That is a valid point. We dealt with about the same issue with the in-memory 
{{Source}} that is part of the {{Create}} transform. It is a requirement that 
we must operate successfully with elements that are not Java {{Serializable}}. 
So it takes some implementation, but I think once it is done the interface 
remains the same. Did you hit a point where you had to enlarge a user-facing 
API or anything like that?

> ValueState could use an initial/default value
> -
>
> Key: BEAM-1335
> URL: https://issues.apache.org/jira/browse/BEAM-1335
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Reporter: Kenneth Knowles
>Priority: Minor
>  Labels: starter
>
> In writing example state code with {{ValueState}} there is almost always a 
> use of {{firstNonNull(state.read(), defaultValue)}}. It would be nice to bake 
> this into the declaration.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)