Re: Beam Java SDK - ReadableState.read() shouldn't it be Nullable?
It looks like there is an existing issue[1]. I updated our correspondence there and we should continue our communication there. 1: https://github.com/apache/beam/issues/24801, On Tue, Jan 3, 2023 at 1:22 PM Reuven Lax wrote: > Ah, that is fair. However right now that doesn't happen either. > > On Tue, Jan 3, 2023 at 12:59 PM Luke Cwik wrote: > >> I think in general ReadableState.read() should not be @Nullable but we >> should allow for the overrides like ValueState to specify that T can >> be @Nullable while others like ListState we should have List<@Nullable T>. >> >> On Tue, Jan 3, 2023 at 12:37 PM Reuven Lax via dev >> wrote: >> >>> It should be @Nullable - I'm not sure why that was removed. >>> >>> On Tue, Jan 3, 2023 at 12:18 PM Ahmet Altay via dev >>> wrote: >>> >>>> Forwarding, because this message got lost in the list moderation. >>>> >>>> -- Forwarded message -- >>>> From: Jeeno Lentin >>>> To: dev@beam.apache.org >>>> Cc: >>>> Bcc: >>>> Date: Fri, 23 Dec 2022 00:36:55 -0500 >>>> Subject: Beam Java SDK - ReadableState.read() shouldn't it be Nullable? >>>> Hi, >>>> >>>> We use the Beam Java SDK and are trying to upgrade version of Beam from >>>> version 2.31.0 to 2.43.0 >>>> >>>> While upgrading, we noticed that @Nullable annotation has been removed >>>> from org.apache.beam.sdk.state.ReadableState.read() >>>> >>>> I traced it back to this PR: https://github.com/apache/beam/pull/16721 >>>> >>>> We have the following concerns >>>> - If ReadableState.read() is really not nullable, shouldn’t there be a >>>> way to specify a default value when creating a state? Such a feature >>>> doesn’t seem to exist. >>>> - And what would it return initially when nothing is written to the >>>> state yet initially? >>>> >>>> Thank you, >>>> Jeeno >>>> >>>
Re: Beam Java SDK - ReadableState.read() shouldn't it be Nullable?
Ah, that is fair. However right now that doesn't happen either. On Tue, Jan 3, 2023 at 12:59 PM Luke Cwik wrote: > I think in general ReadableState.read() should not be @Nullable but we > should allow for the overrides like ValueState to specify that T can > be @Nullable while others like ListState we should have List<@Nullable T>. > > On Tue, Jan 3, 2023 at 12:37 PM Reuven Lax via dev > wrote: > >> It should be @Nullable - I'm not sure why that was removed. >> >> On Tue, Jan 3, 2023 at 12:18 PM Ahmet Altay via dev >> wrote: >> >>> Forwarding, because this message got lost in the list moderation. >>> >>> -- Forwarded message -- >>> From: Jeeno Lentin >>> To: dev@beam.apache.org >>> Cc: >>> Bcc: >>> Date: Fri, 23 Dec 2022 00:36:55 -0500 >>> Subject: Beam Java SDK - ReadableState.read() shouldn't it be Nullable? >>> Hi, >>> >>> We use the Beam Java SDK and are trying to upgrade version of Beam from >>> version 2.31.0 to 2.43.0 >>> >>> While upgrading, we noticed that @Nullable annotation has been removed >>> from org.apache.beam.sdk.state.ReadableState.read() >>> >>> I traced it back to this PR: https://github.com/apache/beam/pull/16721 >>> >>> We have the following concerns >>> - If ReadableState.read() is really not nullable, shouldn’t there be a >>> way to specify a default value when creating a state? Such a feature >>> doesn’t seem to exist. >>> - And what would it return initially when nothing is written to the >>> state yet initially? >>> >>> Thank you, >>> Jeeno >>> >>
Re: Beam Java SDK - ReadableState.read() shouldn't it be Nullable?
I think in general ReadableState.read() should not be @Nullable but we should allow for the overrides like ValueState to specify that T can be @Nullable while others like ListState we should have List<@Nullable T>. On Tue, Jan 3, 2023 at 12:37 PM Reuven Lax via dev wrote: > It should be @Nullable - I'm not sure why that was removed. > > On Tue, Jan 3, 2023 at 12:18 PM Ahmet Altay via dev > wrote: > >> Forwarding, because this message got lost in the list moderation. >> >> -- Forwarded message -- >> From: Jeeno Lentin >> To: dev@beam.apache.org >> Cc: >> Bcc: >> Date: Fri, 23 Dec 2022 00:36:55 -0500 >> Subject: Beam Java SDK - ReadableState.read() shouldn't it be Nullable? >> Hi, >> >> We use the Beam Java SDK and are trying to upgrade version of Beam from >> version 2.31.0 to 2.43.0 >> >> While upgrading, we noticed that @Nullable annotation has been removed >> from org.apache.beam.sdk.state.ReadableState.read() >> >> I traced it back to this PR: https://github.com/apache/beam/pull/16721 >> >> We have the following concerns >> - If ReadableState.read() is really not nullable, shouldn’t there be a >> way to specify a default value when creating a state? Such a feature >> doesn’t seem to exist. >> - And what would it return initially when nothing is written to the state >> yet initially? >> >> Thank you, >> Jeeno >> >
Re: Beam Java SDK - ReadableState.read() shouldn't it be Nullable?
It should be @Nullable - I'm not sure why that was removed. On Tue, Jan 3, 2023 at 12:18 PM Ahmet Altay via dev wrote: > Forwarding, because this message got lost in the list moderation. > > -- Forwarded message -- > From: Jeeno Lentin > To: dev@beam.apache.org > Cc: > Bcc: > Date: Fri, 23 Dec 2022 00:36:55 -0500 > Subject: Beam Java SDK - ReadableState.read() shouldn't it be Nullable? > Hi, > > We use the Beam Java SDK and are trying to upgrade version of Beam from > version 2.31.0 to 2.43.0 > > While upgrading, we noticed that @Nullable annotation has been removed > from org.apache.beam.sdk.state.ReadableState.read() > > I traced it back to this PR: https://github.com/apache/beam/pull/16721 > > We have the following concerns > - If ReadableState.read() is really not nullable, shouldn’t there be a > way to specify a default value when creating a state? Such a feature > doesn’t seem to exist. > - And what would it return initially when nothing is written to the state > yet initially? > > Thank you, > Jeeno >
Fwd: Beam Java SDK - ReadableState.read() shouldn't it be Nullable?
Forwarding, because this message got lost in the list moderation. -- Forwarded message -- From: Jeeno Lentin To: dev@beam.apache.org Cc: Bcc: Date: Fri, 23 Dec 2022 00:36:55 -0500 Subject: Beam Java SDK - ReadableState.read() shouldn't it be Nullable? Hi, We use the Beam Java SDK and are trying to upgrade version of Beam from version 2.31.0 to 2.43.0 While upgrading, we noticed that @Nullable annotation has been removed from org.apache.beam.sdk.state.ReadableState.read() I traced it back to this PR: https://github.com/apache/beam/pull/16721 We have the following concerns - If ReadableState.read() is really not nullable, shouldn’t there be a way to specify a default value when creating a state? Such a feature doesn’t seem to exist. - And what would it return initially when nothing is written to the state yet initially? Thank you, Jeeno