-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-13294] [PROJECT INFRA] Remove MiMa's dependency on spark-class / Spark assembly #11178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
73b1550
b6f1ce8
5528c48
bef62eb
76a365e
9fc0f7a
31854eb
906d8c8
1f995a4
902b1b7
a73118e
64330d6
9a122ad
db8e532
cd7eb04
4756a1e
ae6b002
dae4725
373fd52
8ec1cc4
5d32e74
97b5d78
f9e2b42
4070c0d
86cd513
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ List<String> buildClassPath(String appClassPath) throws IOException { | |
| boolean isTesting = "1".equals(getenv("SPARK_TESTING")); | ||
| if (prependClasses || isTesting) { | ||
| String scala = getScalaVersion(); | ||
| // All projects _except_ assembly and the external/ projects | ||
| // All projects except assemblies: | ||
| List<String> projects = Arrays.asList( | ||
| "common/network-common", | ||
| "common/network-shuffle", | ||
|
|
@@ -155,6 +155,15 @@ List<String> buildClassPath(String appClassPath) throws IOException { | |
| "core", | ||
| "docker-integration-tests", | ||
| "examples", | ||
| "external/akka", | ||
| "external/flume", | ||
| "external/flume-sink", | ||
| "external/kafka", | ||
| "external/mqtt", | ||
| "external/twitter", | ||
| "external/zeromq", | ||
| "extras/kinesis-asl", | ||
|
||
| "extras/spark-ganglia-lgpl", | ||
| "graphx", | ||
| "launcher", | ||
| "mllib", | ||
|
|
@@ -166,7 +175,8 @@ List<String> buildClassPath(String appClassPath) throws IOException { | |
| "streaming", | ||
| "tags", | ||
| "tools", | ||
| "unsafe" | ||
| "unsafe", | ||
| "yarn" | ||
| ); | ||
| if (prependClasses) { | ||
| if (!isTesting) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,11 +41,11 @@ object GenerateMIMAIgnore { | |
| private val mirror = runtimeMirror(classLoader) | ||
|
|
||
| private def isDeveloperApi(sym: unv.Symbol) = sym.annotations.exists { | ||
| _.tpe =:= mirror.staticClass("org.apache.spark.annotation.DeveloperApi").toType | ||
| _.tree.tpe =:= mirror.staticClass("org.apache.spark.annotation.DeveloperApi").toType | ||
| } | ||
|
|
||
| private def isExperimental(sym: unv.Symbol) = sym.annotations.exists { | ||
| _.tpe =:= mirror.staticClass("org.apache.spark.annotation.Experimental").toType | ||
| _.tree.tpe =:= mirror.staticClass("org.apache.spark.annotation.Experimental").toType | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -66,7 +66,7 @@ object GenerateMIMAIgnore { | |
| val ignoredClasses = mutable.HashSet[String]() | ||
| val ignoredMembers = mutable.HashSet[String]() | ||
|
|
||
| for (className <- classes) { | ||
| for (className <- classes.toSeq.sorted) { | ||
| try { | ||
| val classSymbol = mirror.classSymbol(Class.forName(className, false, classLoader)) | ||
| val moduleSymbol = mirror.staticModule(className) | ||
|
|
@@ -90,9 +90,8 @@ object GenerateMIMAIgnore { | |
| if (directlyPrivateSpark || indirectlyPrivateSpark || developerApi || experimental) { | ||
| ignoredClasses += className | ||
| } | ||
| // check if this class has package-private/annotated members. | ||
| ignoredMembers ++= getAnnotatedOrPackagePrivateMembers(classSymbol) | ||
|
|
||
| ignoredMembers ++= getInnerFunctions(className) | ||
| } catch { | ||
| // scalastyle:off println | ||
| case _: Throwable => println("Error instrumenting class:" + className) | ||
|
|
@@ -104,16 +103,19 @@ object GenerateMIMAIgnore { | |
|
|
||
| /** Scala reflection does not let us see inner function even if they are upgraded | ||
| * to public for some reason. So had to resort to java reflection to get all inner | ||
| * functions with $$ in there name. | ||
| * functions with $$ in their name. | ||
| */ | ||
| def getInnerFunctions(classSymbol: unv.ClassSymbol): Seq[String] = { | ||
| def getInnerFunctions(className: String): Seq[String] = { | ||
| try { | ||
| Class.forName(classSymbol.fullName, false, classLoader).getMethods.map(_.getName) | ||
| .filter(_.contains("$$")).map(classSymbol.fullName + "." + _) | ||
| Class.forName(className, false, classLoader) | ||
| .getMethods | ||
| .map(_.getName) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition to the reformatting here, I also changed |
||
| .filter(_.contains("$$")) | ||
| .map(className + "." + _) | ||
| } catch { | ||
| case t: Throwable => | ||
| // scalastyle:off println | ||
| println("[WARN] Unable to detect inner functions for class:" + classSymbol.fullName) | ||
| println("[WARN] Unable to detect inner functions for class:" + className) | ||
| // scalastyle:on println | ||
| Seq.empty[String] | ||
| } | ||
|
|
@@ -124,7 +126,7 @@ object GenerateMIMAIgnore { | |
| x.fullName.startsWith("java") || x.fullName.startsWith("scala") | ||
| ).filter(x => | ||
| isPackagePrivate(x) || isDeveloperApi(x) || isExperimental(x) | ||
| ).map(_.fullName) ++ getInnerFunctions(classSymbol) | ||
| ).map(_.fullName) | ||
| } | ||
|
|
||
| def main(args: Array[String]) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW extras/* is now in external/, and docker* directories are also in external/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that we don't support MiMa for the Maven build anyways, so I can just safely pull this in from one of SBT's
fullClasspathoutputs.