@@ -108,7 +108,7 @@ abstract class DStream[T: ClassTag] (
108108 def context = ssc
109109
110110 /* Set the creation call site */
111- private [streaming] val creationSite = DStream .getCallSite ()
111+ private [streaming] val creationSite = DStream .getCreationSite ()
112112
113113 /** Persist the RDDs of this DStream with the given storage level */
114114 def persist (level : StorageLevel ): DStream [T ] = {
@@ -805,25 +805,25 @@ abstract class DStream[T: ClassTag] (
805805private [streaming] object DStream {
806806
807807 /** Get the creation site of a DStream from the stack trace of when the DStream is created. */
808- def getCallSite (): CallSite = {
808+ def getCreationSite (): CallSite = {
809809 val SPARK_CLASS_REGEX = """ ^org\.apache\.spark""" .r
810810 val SPARK_STREAMING_TESTCLASS_REGEX = """ ^org\.apache\.spark\.streaming\.test""" .r
811811 val SPARK_EXAMPLES_CLASS_REGEX = """ ^org\.apache\.spark\.examples""" .r
812812 val SCALA_CLASS_REGEX = """ ^scala""" .r
813813
814- /** Filtering function that returns true for classes that belong to a streaming application */
815- def streamingClassFilterFunc (className : String ): Boolean = {
814+ /** Filtering function that excludes non-user classes for a streaming application */
815+ def streamingExclustionFunction (className : String ): Boolean = {
816816 def doesMatch (r : Regex ) = r.findFirstIn(className).isDefined
817817 val isSparkClass = doesMatch(SPARK_CLASS_REGEX )
818818 val isSparkExampleClass = doesMatch(SPARK_EXAMPLES_CLASS_REGEX )
819819 val isSparkStreamingTestClass = doesMatch(SPARK_STREAMING_TESTCLASS_REGEX )
820820 val isScalaClass = doesMatch(SCALA_CLASS_REGEX )
821821
822822 // If the class is a spark example class or a streaming test class then it is considered
823- // as a streaming application class. Otherwise, consider any non-Spark and non-Scala class
824- // as streaming application class .
825- isSparkExampleClass || isSparkStreamingTestClass || ! (isSparkClass || isScalaClass)
823+ // as a streaming application class and don't exclude . Otherwise, exclude any
824+ // non-Spark and non-Scala class, as the rest would streaming application classes .
825+ (isSparkClass || isScalaClass) && ! isSparkExampleClass && ! isSparkStreamingTestClass
826826 }
827- org.apache.spark.util.Utils .getCallSite(streamingClassFilterFunc )
827+ org.apache.spark.util.Utils .getCallSite(streamingExclustionFunction )
828828 }
829829}
0 commit comments