zoukankan      html  css  js  c++  java
  • Spark Streaming:updateStateByKey报错 is not applicable for the arguments...

    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使用updateStateByKey报错:

    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>>(){})

    解决办法:很可能是Optional导包导错了,要导com.google.common.base.Optional

  • 相关阅读:
    词根——rect
    6
    7
    5
    3
    4
    2
    1
    DBUtils
    Websocket
  • 原文地址:https://www.cnblogs.com/144823836yj/p/11052194.html
Copyright © 2011-2022 走看看