Please take a look at:
examples/scala-2.10/src/main/java/org/apache/spark/examples/streaming/JavaDirectKafkaWordCount.java
which was checked in yesterday.

On Sat, Feb 7, 2015 at 10:53 AM, Eduardo Costa Alfaia <
e.costaalf...@unibs.it> wrote:

> Hi Ted,
>
> I’ve seen the codes, I am using  JavaKafkaWordCount.java but I would like
> reproducing in java that I’ve done in scala. Is it possible doing the same
> thing that scala code does in java?
> Principally this code below or something looks liked:
>
> val KafkaDStreams = (1 to numStreams) map {_ =>
>>      KafkaUtils.createStream[String, String, StringDecoder,
>> StringDecoder](ssc, kafkaParams, topicMap,storageLevel =
>> StorageLevel.MEMORY_ONLY).map(_._2)
>>
>
>
>
>
> On Feb 7, 2015, at 19:32, Ted Yu <yuzhih...@gmail.com> wrote:
>
> Can you take a look at:
>
>
> ./examples/scala-2.10/src/main/java/org/apache/spark/examples/streaming/JavaKafkaWordCount.java
>
> ./external/kafka/src/test/java/org/apache/spark/streaming/kafka/JavaKafkaStreamSuite.java
>
> Cheers
>
> On Sat, Feb 7, 2015 at 9:45 AM, Eduardo Costa Alfaia <
> e.costaalf...@unibs.it> wrote:
>
>> Hi Guys,
>>
>> How could I doing in Java the code scala below?
>>
>> val KafkaDStreams = (1 to numStreams) map {_ =>
>>      KafkaUtils.createStream[String, String, StringDecoder,
>> StringDecoder](ssc, kafkaParams, topicMap,storageLevel =
>> StorageLevel.MEMORY_ONLY).map(_._2)
>>
>>   }
>>     val unifiedStream = ssc.union(KafkaDStreams)
>>     val sparkProcessingParallelism = 1
>>     unifiedStream.repartition(sparkProcessingParallelism)
>>
>> Thanks Guys
>>
>> Informativa sulla Privacy: http://www.unibs.it/node/8155
>
>
>
>
> Informativa sulla Privacy: http://www.unibs.it/node/8155
>

Reply via email to