apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Weise (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (APEXMALHAR-998) Compilation error while using UniqueValueCount operator.
Date Wed, 01 Jun 2016 16:07:59 GMT

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

Thomas Weise resolved APEXMALHAR-998.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.5.0

> Compilation error while using UniqueValueCount operator.
> --------------------------------------------------------
>
>                 Key: APEXMALHAR-998
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-998
>             Project: Apache Apex Malhar
>          Issue Type: Bug
>            Reporter: Tushar Gosavi
>            Assignee: Tushar Gosavi
>             Fix For: 3.5.0
>
>
> Got compilation error while using UniqueValueCount operator,
> [ERROR] bootstrap class path not set in conjunction with -source 1.6
> /home/tushar/work/github/Malhar/demos/src/main/java/com/datatorrent/demos/uniquevaluetest/Application.java:[31,11]
error: no suitable method found for addStream(String,DefaultOutputPort<KeyValPair<String,Integer>>,DefaultInputPort<KeyValPair<String,Object>>)
> The problem is type  KeyValPair<String, Integer> is different than type <String,
Object> used in operator, generic type needs to be extended from Object for typematch.
> The fix is
> --- a/library/src/main/java/com/datatorrent/lib/algo/UniqueValueCount.java
> +++ b/library/src/main/java/com/datatorrent/lib/algo/UniqueValueCount.java
> @@ -46,10 +46,9 @@ public class UniqueValueCount<K> extends BaseOperator {
>  
>  
>      @InputPortFieldAnnotation(name="inputPort")
> -    public transient DefaultInputPort<KeyValPair<K,Object>> inputPort =
new DefaultInputPort<KeyValPair<K,Object>>() {
> -
> +    public transient DefaultInputPort<KeyValPair<K,? extends Object>> inputPort
= new DefaultInputPort<KeyValPair<K,? extends Object>>() {
>          @Override
> -        public void process(KeyValPair<K, Object> pair) {
> +        public void process(KeyValPair<K, ? extends Object> pair) {
>              Set<Object> values= interimUniqueValues.get(pair.getKey());
>              if(values==null){
>                  values=Sets.newHashSet();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message