Giter Site home page Giter Site logo

Comments (9)

dibbhatt avatar dibbhatt commented on September 28, 2024

Which version of the consumer you are running ? It is due to version of your Spark (1.6.0) and version in pom doesn't match. You can git clone the code and update the consumer pom to match your version and try. But using spark 1.6 you may see couple of compilation issue which are easy to solve.

Here are the steps you can try.

  1. git clone the latest code.

  2. modify pom.xml to match your kafka and spark version ( including scala version)

e.g.

**
<spark.version>1.6.0</spark.version>
<kafka.version>0.10.2.0</kafka.version>

  <groupId>org.apache.spark</groupId>
  <artifactId>spark-core_2.10</artifactId>**

and

  **<groupId>org.apache.spark</groupId>
  <artifactId>spark-streaming_2.10</artifactId>**

and

  **<groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.10</artifactId>**
  1. As Spark 1.6 and 2.0 has some incompatible changes, you need to remove one Listener call back from
    consumer.kafka.ReceiverStreamListener.java

remove this import

import org.apache.spark.streaming.scheduler.StreamingListenerStreamingStarted;

and remove this call back

**@Override
public void onStreamingStarted(StreamingListenerStreamingStarted arg0) {
}**
  1. Spark 1.6 and 2.0 has another incompatibility for return type of PairFlatMapFunction. So you need to modify this file consumer.kafka.PartitionOffsetPair.java

change return type of call method

public Iterator<Tuple2<Integer, Long>> call(Iterator<MessageAndMetadata> it)

to

public Iterable<Tuple2<Integer, Long>> call(Iterator<MessageAndMetadata> it)

And change the return type from

    return kafkaPartitionToOffsetList.iterator();

to

    **return kafkaPartitionToOffsetList;**

That's it. Build the consumer and you should be all set to use it for Spark 1.6 and Kafka 0.10.2

Let me know if you face any issues.

Dibyendu

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on September 28, 2024

Or another option is use consumer version 1.0.9. That will work with Spark 1.6

	<dependency>
		<groupId>dibbhatt</groupId>
		<artifactId>kafka-spark-consumer</artifactId>
		**<version>1.0.9</version>**
	</dependency>

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on September 28, 2024

Here is the V 1.0.9 READ ME
https://github.com/dibbhatt/kafka-spark-consumer/tree/117f98ccf02ad4f6e5a8b8918b5db097e7d3a3d4

from kafka-spark-consumer.

MLNW avatar MLNW commented on September 28, 2024

Thank you for your quick response!

I used your first approach and modified the latest code to use my versions of Kafka, Spark and Scala. Seems to work.

I will do some more extensive testing during this week. If I find anything else I'll let you know.

Cheers!

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on September 28, 2024

Perfect. Do let me know if you see any issues or need any help on tuning various knobs .

from kafka-spark-consumer.

LinMingQiang avatar LinMingQiang commented on September 28, 2024

When spark job was submitted The system loaded the default jar of CDH(spark-assembly-1.6.0-cdh5.14.4-hadoop2.6.0-cdh5.14.4.jar)。The Kafka version is not 010。(0.9.0)

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on September 28, 2024

Hi @LinMingQiang , in your Application pom, what version of jars you have specified ?

from kafka-spark-consumer.

LinMingQiang avatar LinMingQiang commented on September 28, 2024

spark 1.6.0 kafka 0.10.0

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on September 28, 2024

Whats the issue you see ? Is the streaming job not running ?

from kafka-spark-consumer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.