Package org.apache.spark.streaming.util
Class RawTextHelper
Object
org.apache.spark.streaming.util.RawTextHelper
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic longadd(long v1, long v2) static longmax(long v1, long v2) splitAndCountPartitions(scala.collection.Iterator<String> iter) Splits lines and counts the words.static longsubtract(long v1, long v2) Gets the top k words in terms of word counts.static voidwarmUp(SparkContext sc) Warms up the SparkContext in master and executor by running tasks to force JIT kick in before real workload starts.
- 
Constructor Details- 
RawTextHelperpublic RawTextHelper()
 
- 
- 
Method Details- 
splitAndCountPartitionspublic static scala.collection.Iterator<scala.Tuple2<String,Object>> splitAndCountPartitions(scala.collection.Iterator<String> iter) Splits lines and counts the words.- Parameters:
- iter- (undocumented)
- Returns:
- (undocumented)
 
- 
topKpublic static scala.collection.Iterator<scala.Tuple2<String,Object>> topK(scala.collection.Iterator<scala.Tuple2<String, Object>> data, int k) Gets the top k words in terms of word counts. Assumes that each word exists only once in thedataiterator (that is, the counts have been reduced).- Parameters:
- data- (undocumented)
- k- (undocumented)
- Returns:
- (undocumented)
 
- 
warmUpWarms up the SparkContext in master and executor by running tasks to force JIT kick in before real workload starts.- Parameters:
- sc- (undocumented)
 
- 
addpublic static long add(long v1, long v2) 
- 
subtractpublic static long subtract(long v1, long v2) 
- 
maxpublic static long max(long v1, long v2) 
 
-