Package org.apache.spark.streaming.util
Class RawTextHelper
Object
org.apache.spark.streaming.util.RawTextHelper
- 
Constructor Summary
Constructors - 
Method Summary
Modifier 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
- 
RawTextHelper
public RawTextHelper() 
 - 
 - 
Method Details
- 
splitAndCountPartitions
public 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)
 
 - 
topK
public 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)
 
 - 
warmUp
Warms up the SparkContext in master and executor by running tasks to force JIT kick in before real workload starts.- Parameters:
 sc- (undocumented)
 - 
add
public static long add(long v1, long v2)  - 
subtract
public static long subtract(long v1, long v2)  - 
max
public static long max(long v1, long v2)  
 -