Should I leave the variable as transient?
问题 I have been experimenting with Apache Spark trying to solve some queries like top-k, skyline etc. I have made a wrapper which encloses SparkConf and JavaSparkContext named SparkContext . This class also implements serializable but since SparkConf and JavaSparkContext are not serializable then the class isn't either. I have a class solving the topK query named TopK , the class implements serializable but the class also has a SparkContext member variable which is not serializable (for the