beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenneth Knowles (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BEAM-2304) State declared with one class cannot be accessed as a superclass (applies to BagState|CombiningState <: GroupingState)
Date Tue, 16 May 2017 18:21:04 GMT

     [ https://issues.apache.org/jira/browse/BEAM-2304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kenneth Knowles updated BEAM-2304:
----------------------------------
    Description: 
The following code:

{code}
@StateId("foo")
            private final StateSpec<CombiningState<Integer, int[], Integer>> state
=
                StateSpecs.combining(Sum.ofIntegers());
            @ProcessElement
            public void processElement(ProcessContext c,
                                       @StateId("foo") GroupingState<Integer, Integer>
state) {
}
{code}

Fails with: 

{code}
parameter of type GroupingState<Integer, Integer> at index 1: reference to StateId exists
with different type CombiningState<Integer, int[], Integer>
{code}

However since GroupingState<Integer, Integer> is the base class, ideally this should
work - and would make the API easier to use if it did.





  was:
The following code:

@StateId("foo")
            private final StateSpec<CombiningState<Integer, int[], Integer>> state
=
                StateSpecs.combining(Sum.ofIntegers());
            @ProcessElement
            public void processElement(ProcessContext c,
                                       @StateId("foo") GroupingState<Integer, Integer>
state) {
}

Fails with: 

parameter of type GroupingState<Integer, Integer> at index 1: reference to StateId exists
with different type CombiningState<Integer, int[], Integer>

However since GroupingState<Integer, Integer> is the base class, ideally this should
work - and would make the API easier to use if it did.






> State declared with one class cannot be accessed as a superclass (applies to BagState|CombiningState
<: GroupingState)
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-2304
>                 URL: https://issues.apache.org/jira/browse/BEAM-2304
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Reuven Lax
>            Assignee: Kenneth Knowles
>              Labels: starter
>
> The following code:
> {code}
> @StateId("foo")
>             private final StateSpec<CombiningState<Integer, int[], Integer>>
state =
>                 StateSpecs.combining(Sum.ofIntegers());
>             @ProcessElement
>             public void processElement(ProcessContext c,
>                                        @StateId("foo") GroupingState<Integer, Integer>
state) {
> }
> {code}
> Fails with: 
> {code}
> parameter of type GroupingState<Integer, Integer> at index 1: reference to StateId
exists with different type CombiningState<Integer, int[], Integer>
> {code}
> However since GroupingState<Integer, Integer> is the base class, ideally this should
work - and would make the API easier to use if it did.



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

Mime
View raw message