Skip to content

Commit

Permalink
Change yetus dependency to compile in spark modules
Browse files Browse the repository at this point in the history
Due to Spark’s usage of reflection the Yetus annotation
is required at runtime.

Because it is getting in the way of other development
and Yetus is a small dependency, I changed the scope
to compile in the Spark modules to ensure the class
is available.

See KUDU-2500 for details and to track the
final solution.

Change-Id: I16867a75b7f29f57c557449f94e52439cb9642c9
Reviewed-on: http://gerrit.cloudera.org:8080/10927
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <[email protected]>
Reviewed-by: Tony Foerster <[email protected]>
  • Loading branch information
granthenke committed Jul 13, 2018
1 parent d074de8 commit daee555
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 27 deletions.
4 changes: 2 additions & 2 deletions java/kudu-backup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ dependencies {
// Make sure wrong Scala version is not pulled in.
exclude group: "org.scala-lang", module: "scala-library"
}
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
compile libs.yetusAnnotations

provided libs.scalaLibrary
provided libs.sparkAvro
provided libs.sparkCore
provided libs.sparkSql
provided libs.slf4jApi

optional libs.yetusAnnotations

testCompile project(path: ":kudu-client", configuration: "shadowTest")
testCompile project(path: ":kudu-spark", configuration: "test")
testCompile libs.junit
Expand Down
14 changes: 6 additions & 8 deletions java/kudu-backup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
</dependency>

<dependency>
<groupId>com.databricks</groupId>
Expand Down Expand Up @@ -102,14 +108,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
<optional>true</optional>
</dependency>


<dependency>
<groupId>org.apache.kudu</groupId>
<artifactId>kudu-${spark.version.label}_${scala.binary.version}</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions java/kudu-spark-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ dependencies {
compile project(path: ":kudu-client", configuration: "shadow")
compile project(path: ":kudu-client-tools", configuration: "shadow")
compile project(path: ":kudu-spark", configuration: "shadow")
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
compile libs.yetusAnnotations

provided libs.scalaLibrary
provided libs.sparkAvro
provided libs.sparkCore
provided libs.sparkSql
provided libs.slf4jApi

optional libs.yetusAnnotations

testCompile project(path: ":kudu-client", configuration: "shadowTest")
testCompile project(path: ":kudu-spark", configuration: "test")
testCompile libs.junit
Expand Down
13 changes: 6 additions & 7 deletions java/kudu-spark-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<artifactId>kudu-${spark.version.label}_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
</dependency>

<dependency>
<groupId>com.databricks</groupId>
Expand Down Expand Up @@ -91,13 +97,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.kudu</groupId>
<artifactId>kudu-client</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion java/kudu-spark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ apply from: "$rootDir/gradle/shadow.gradle"

dependencies {
compile project(path: ":kudu-client", configuration: "shadow")
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
compile libs.yetusAnnotations

provided libs.scalaLibrary
provided libs.sparkCore
provided libs.sparkSql
provided libs.slf4jApi

optional libs.yetusAnnotations

testCompile project(path: ":kudu-client", configuration: "shadowTest")
testCompile libs.junit
Expand Down
13 changes: 6 additions & 7 deletions java/kudu-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<artifactId>kudu-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
</dependency>

<dependency>
<groupId>org.apache.spark</groupId>
Expand Down Expand Up @@ -67,13 +73,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.version}</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.kudu</groupId>
<artifactId>kudu-client</artifactId>
Expand Down

0 comments on commit daee555

Please sign in to comment.