Spark Streaming Kinesis partition key and sequence number log in java

房东的猫 提交于 2020-06-09 04:54:07

问题


We are using spark 2.4.3 in java. We would like to log the partition key and the sequence number of every event. The overloaded create stream function of the kinesis utils always throws a compilation error.

Function<Record,Record> printSeq = s -> s;
KinesisUtils.createStream(
  jssc,
  appName,
  streamName,
  endPointUrl,
  regionName,
  InitialPositionInStream.TRIM_HORIZON,
  kinesisCheckpointInterval,
  StorageLevel.MEMORY_AND_DISK_SER(),
  printSeq,
  Record.class);

The exception is as follows:

no suitable method found for createStream(org.apache.spark.streaming.api.java.JavaStreamingContext,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream,org.apache.spark.streaming.Duration,org.apache.spark.storage.StorageLevel,java.util.function.Function,java.lang.Class)

JAVA DOCS : https://spark.apache.org/docs/latest/api/java/org/apache/spark/streaming/kinesis/KinesisUtils.html#createStream-org.apache.spark.streaming.api.java.JavaStreamingContext-java.lang.String-java.lang.String-java.lang.String-java.lang.String-com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream-org.apache.spark.streaming.Duration-org.apache.spark.storage.StorageLevel-org.apache.spark.api.java.function.Function-java.lang.Class-

Is there a way out?

来源:https://stackoverflow.com/questions/61062458/spark-streaming-kinesis-partition-key-and-sequence-number-log-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!