This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class InstrumentedSet<T> extends ForwardingSet<T> { | |
private static int insertionCount; | |
public InstrumentedSet(Set<T> s) { | |
super(s); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class ForwardingSet<T> implements Set<T> { | |
private final Set<T> set; | |
ForwardingSet(Set<T> set) { | |
this.set = set; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question 1 | |
scala> val line = "Hello, World" | |
line: String = Hello, World | |
scala> val rdd = sc.parallelize(List(line)) | |
rdd: org.apache.spark.rdd.RDD[String] = ParallelCollectionRDD[0] at parallelize at <console>:26 | |
scala> rdd.collect | |
res2: Array[String] = Array(Hello, World) | |
Question 2 | |
scala> val rdd = sc.parallelize(List(1,1,2,3,4,4)) |