Skip to content

[SPARK-8015] [flume] Remove Guava dependency from flume-sink. #6555

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

Closed
wants to merge 5 commits into from

Conversation

vanzin
Copy link
Contributor

@vanzin vanzin commented Jun 1, 2015

The minimal change would be to disable shading of Guava in the module,
and rely on the transitive dependency from other libraries instead. But
since Guava's use is so localized, I think it's better to just not use
it instead, so I replaced that code and removed all traces of Guava from
the module's build.

The minimal change would be to disable shading of Guava in the module,
and rely on the transitive dependency from other libraries instead. But
since Guava's use is so localized, I think it's better to just not use
it instead, so I replaced that code and removed all traces of Guava from
the module's build.
@vanzin
Copy link
Contributor Author

vanzin commented Jun 1, 2015

I verified that there are no references to Guava in the generated bytecode and that Guava does not show up in mvn dependency:tree.

@SparkQA
Copy link

SparkQA commented Jun 1, 2015

Test build #33905 has finished for PR 6555 at commit 2d79260.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

<artifactId>maven-shade-plugin</artifactId>
<configuration>
<relocations combine.self="override" />
</configuration>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth adding a short comment here explaining why this is necessary? maybe this is obvious to others more versed in maven, but it was a little mysterious to me. Then again we don't doc a lot of the intricacies of the build system. anyway, just a suggestion, I'll leave it up to your judgement.

@squito
Copy link
Contributor

squito commented Jun 1, 2015

jenkins, retest this please

@SparkQA
Copy link

SparkQA commented Jun 1, 2015

Test build #33907 has finished for PR 6555 at commit 2d79260.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@harishreedharan
Copy link
Contributor

+1. LGTM

@SparkQA
Copy link

SparkQA commented Jun 1, 2015

Test build #33908 has finished for PR 6555 at commit 6e0942d.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@vanzin
Copy link
Contributor Author

vanzin commented Jun 1, 2015

Hmm... the build failure doesn't seem related to the changes, but I'll take another look.

Not sure what's wrong, but running sbt with no profiles enabled causes
an error about not being able to resolve version "${thrift.version}" of
libthrift.
@SparkQA
Copy link

SparkQA commented Jun 1, 2015

Test build #33909 has finished for PR 6555 at commit b7a0349.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@harishreedharan
Copy link
Contributor

Some of the test code's transitive dependencies seem to pull in Preconditions. How about including Guava as a test dependency? Does that complicate things?

@vanzin
Copy link
Contributor Author

vanzin commented Jun 1, 2015

Hmm. Wonder how those tests passed locally. Yeah, I'll add the dependency in test scope.

@SparkQA
Copy link

SparkQA commented Jun 1, 2015

Test build #33914 has finished for PR 6555 at commit c38228d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Flume 1.4.0 depends on is "3.4.0.Final" .
-->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to add this in test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I missed the earlier conversation. But instead of randomly adding guava back for test, its better to remove the wrong version of guava that is coming in from somewhere, and allow Flume's guava dependency to be used. At least, it needs to be understood. Could you check the dependency tree to find the wrong guava version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no wrong version of Guava.

I added this because I removed Guava from compile-scope dependencies, to avoid having people use it in this module. Not because of a conflict.

If instead you'd rather keep it, but at the same version as flume (whatever that is), it could be done also. I kinda prefer avoiding it, though.

As I mention in the PR description, the minimal fix doesn't remove Guava at all, just removes the code to relocate it. I just thought it would be better to avoid another potential dependency mess here since it's not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah, I was misunderstanding the problem. It makes sense now. Can you add comments on why Guava and thrift has been excluded, explaining the problem and mentioning the JIRA.

@srowen
Copy link
Member

srowen commented Jun 2, 2015

Lgtm pending tests

@SparkQA
Copy link

SparkQA commented Jun 2, 2015

Test build #33994 has finished for PR 6555 at commit c0ceea8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@tdas
Copy link
Contributor

tdas commented Jun 2, 2015

LGTM. Merging this, in master and branch 1.4.

asfgit pushed a commit that referenced this pull request Jun 2, 2015
The minimal change would be to disable shading of Guava in the module,
and rely on the transitive dependency from other libraries instead. But
since Guava's use is so localized, I think it's better to just not use
it instead, so I replaced that code and removed all traces of Guava from
the module's build.

Author: Marcelo Vanzin <[email protected]>

Closes #6555 from vanzin/SPARK-8015 and squashes the following commits:

c0ceea8 [Marcelo Vanzin] Add comments about dependency management.
c38228d [Marcelo Vanzin] Add guava dep in test scope.
b7a0349 [Marcelo Vanzin] Add libthrift exclusion.
6e0942d [Marcelo Vanzin] Add comment in pom.
2d79260 [Marcelo Vanzin] [SPARK-8015] [flume] Remove Guava dependency from flume-sink.

(cherry picked from commit 0071bd8)
Signed-off-by: Tathagata Das <[email protected]>
@asfgit asfgit closed this in 0071bd8 Jun 2, 2015
@vanzin vanzin deleted the SPARK-8015 branch June 2, 2015 18:24
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
The minimal change would be to disable shading of Guava in the module,
and rely on the transitive dependency from other libraries instead. But
since Guava's use is so localized, I think it's better to just not use
it instead, so I replaced that code and removed all traces of Guava from
the module's build.

Author: Marcelo Vanzin <[email protected]>

Closes apache#6555 from vanzin/SPARK-8015 and squashes the following commits:

c0ceea8 [Marcelo Vanzin] Add comments about dependency management.
c38228d [Marcelo Vanzin] Add guava dep in test scope.
b7a0349 [Marcelo Vanzin] Add libthrift exclusion.
6e0942d [Marcelo Vanzin] Add comment in pom.
2d79260 [Marcelo Vanzin] [SPARK-8015] [flume] Remove Guava dependency from flume-sink.
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
The minimal change would be to disable shading of Guava in the module,
and rely on the transitive dependency from other libraries instead. But
since Guava's use is so localized, I think it's better to just not use
it instead, so I replaced that code and removed all traces of Guava from
the module's build.

Author: Marcelo Vanzin <[email protected]>

Closes apache#6555 from vanzin/SPARK-8015 and squashes the following commits:

c0ceea8 [Marcelo Vanzin] Add comments about dependency management.
c38228d [Marcelo Vanzin] Add guava dep in test scope.
b7a0349 [Marcelo Vanzin] Add libthrift exclusion.
6e0942d [Marcelo Vanzin] Add comment in pom.
2d79260 [Marcelo Vanzin] [SPARK-8015] [flume] Remove Guava dependency from flume-sink.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants