scala - Adding an Array to ConcurrentLinkedQueue -


i trying add array concurrentlinkedqueue (collecteddata) in scala 2.11:

stream.foreachrdd { rdd => collections.addall(collecteddata, rdd.collect()) } 

i got following compilation error:

[error]  found   : java.util.concurrent.concurrentlinkedqueue[(string, string)] [error]  required: java.util.collection[_ >: java.io.serializable] [error] note: (string, string) <: any, java-defined trait collection invariant in type e. [error] may wish investigate wildcard type such `_ <: any`. (sls 3.2.10) [error]     stream.foreachrdd { rdd => collections.addall(allreceived, rdd.collect()) } 

can give me hint these errors mean?

what type of stream?

the error message tells you, have collection tuples of strings. need collection, can insert instances of serializable. means somewhere type inferred did not intend.

did explicitly declare type of stream? if not, try doing , type error somewhere, real problem is.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -