i am getting error at this line val Array(outputDirectory, Utils.IntParam(numTweetsToCollect), Utils.IntParam(intervalSecs), Utils.IntParam(partitionsEachInterval)) = Utils.parseCommandLineWithTwitterCredentials(args)recursive value x$7 needs typerecursive value x$1 needs typewhat does this error meaning, please guide me how to resolve this error.object Collect { private var numTweetsCollected = 0L private var partNum = 0 private var gson = new Gson() def main(args: Array[String]) { // Process program arguments and set properties if (args.length < 3) { System.err.println("Usage: " + this.getClass.getSimpleName + "<outputDirectory> <numTweetsToCollect> <intervalInSeconds> <partitionsEachInterval>") System.exit(1) } val Array(outputDirectory, Utils.IntParam(numTweetsToCollect), Utils.IntParam(intervalSecs), Utils.IntParam(partitionsEachInterval)) = Utils.parseCommandLineWithTwitterCredentials(args) val outputDir = new File(outputDirectory.toString) if (outputDir.exists()) { System.err.println("ERROR - %s already exists: delete or specify another directory".format( outputDirectory)) System.exit(1) } outputDir.mkdirs() println("Initializing Streaming Spark Context...") val conf = new SparkConf().setAppName(this.getClass.getSimpleName) val sc = new SparkContext(conf) val ssc = new StreamingContext(sc, Seconds(intervalSecs)) val tweetStream = TwitterUtils.createStream(ssc, Utils.getAuth) .map(gson.toJson(_)) tweetStream.foreachRDD((rdd, time) => { val count = rdd.count() if (count > 0) { val outputRDD = rdd.repartition(partitionsEachInterval) outputRDD.saveAsTextFile(outputDirectory + "/tweets_" + time.milliseconds.toString) numTweetsCollected += count if (numTweetsCollected > numTweetsToCollect) { System.exit(0) } } }) ssc.start() ssc.awaitTermination() }} 解决方案 Try removing the Utils.IntParam(.. from your pattern matched values. Extract the values, then parse them separately. 这篇关于递归值x $ 5需要类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!