ones.updateStateByKey(new Function2<List<Integer>, Optional<Integer>, Optional<Integer>>() { @Override public Optional<Integer> call(List<Integer> arg0, Optional<Integer> arg1) throws Exception { // TODO Auto-generated method stub return null; } });
JavaPairDStream<String, Integer> ones use updateStateByKey error:
The method updateStateByKey(Function2<List<Integer>,Optional<S>,Optional<S>>) in the type JavaPairDStream<String,Integer> is not applicable for the arguments (new Function2<List<Integer>,Optional<Integer>,Optional<Integer>>(){})
Solution: It is likely that the Optional package was misdirected, to direct com.google.common.base.Optional
Similar Posts:
- How to Use Array.prototype.slice.call(arguments)
- [Solved] Mybatis error: attempted to return null from a method with a primitive return type (int)
- Convert Object to List>, avoiding Unchecked cast: ‘java.lang.Object’ to ‘java.util.List
- [Solved] IllegalArgumentException: object is not an instance of declaring class
- [Solved] Android.content.res.Resources$NotFoundException: String resource ID #0x0
- TypeError: ‘list’ object cannot be interpreted as an integer
- [leetcode] 140. Word break II word split II
- How to Solve Console error: index: 0, size: 0
- How to Solve Java Error: java.util.Arrays$ArrayList cannot be cast to java.util.ArrayList