diff options
author | Reza Zadeh <rizlar@gmail.com> | 2014-01-17 14:34:03 -0800 |
---|---|---|
committer | Reza Zadeh <rizlar@gmail.com> | 2014-01-17 14:34:03 -0800 |
commit | caf97a25a2bd70ef5164c3ce0e8b59a8e39eb288 (patch) | |
tree | 3eaffca1eb0c9031c4f9acc2b91ea915beec25b1 /examples/src/main/scala | |
parent | 4e96757793e7aee165381f80a60b3f46f60c9ebc (diff) | |
parent | d749d472b37448edb322bc7208a3db925c9a4fc2 (diff) | |
download | spark-caf97a25a2bd70ef5164c3ce0e8b59a8e39eb288.tar.gz spark-caf97a25a2bd70ef5164c3ce0e8b59a8e39eb288.tar.bz2 spark-caf97a25a2bd70ef5164c3ce0e8b59a8e39eb288.zip |
Merge remote-tracking branch 'upstream/master' into sparsesvd
Diffstat (limited to 'examples/src/main/scala')
-rw-r--r-- | examples/src/main/scala/org/apache/spark/streaming/examples/NetworkWordCount.scala | 3 | ||||
-rw-r--r-- | examples/src/main/scala/org/apache/spark/streaming/examples/StreamingExamples.scala | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/examples/src/main/scala/org/apache/spark/streaming/examples/NetworkWordCount.scala b/examples/src/main/scala/org/apache/spark/streaming/examples/NetworkWordCount.scala index 25f7013307..0226475712 100644 --- a/examples/src/main/scala/org/apache/spark/streaming/examples/NetworkWordCount.scala +++ b/examples/src/main/scala/org/apache/spark/streaming/examples/NetworkWordCount.scala @@ -19,6 +19,7 @@ package org.apache.spark.streaming.examples import org.apache.spark.streaming.{Seconds, StreamingContext} import org.apache.spark.streaming.StreamingContext._ +import org.apache.spark.storage.StorageLevel /** * Counts words in text encoded with UTF8 received from the network every second. @@ -48,7 +49,7 @@ object NetworkWordCount { // Create a NetworkInputDStream on target ip:port and count the // words in input stream of \n delimited text (eg. generated by 'nc') - val lines = ssc.socketTextStream(args(1), args(2).toInt) + val lines = ssc.socketTextStream(args(1), args(2).toInt, StorageLevel.MEMORY_ONLY_SER) val words = lines.flatMap(_.split(" ")) val wordCounts = words.map(x => (x, 1)).reduceByKey(_ + _) wordCounts.print() diff --git a/examples/src/main/scala/org/apache/spark/streaming/examples/StreamingExamples.scala b/examples/src/main/scala/org/apache/spark/streaming/examples/StreamingExamples.scala index d41d84a980..99f1502046 100644 --- a/examples/src/main/scala/org/apache/spark/streaming/examples/StreamingExamples.scala +++ b/examples/src/main/scala/org/apache/spark/streaming/examples/StreamingExamples.scala @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.spark.streaming.examples import org.apache.spark.Logging |