Skip to content
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

Use apache commons for Stopwatch instead of guava #221

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ehsanhaq
Copy link

@ehsanhaq ehsanhaq commented Jun 12, 2018

In the later version of guava from 15 onwards the constructor method of StopWatch has been deprecated, and throws following exception.

java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V from class magellan.mapreduce.ShapeInputFormat
at magellan.mapreduce.ShapeInputFormat.computeSplits(ShapeInputFormat.scala:50)
at magellan.mapreduce.ShapeInputFormat.getSplits(ShapeInputFormat.scala:43)
at org.apache.spark.rdd.NewHadoopRDD.getPartitions(NewHadoopRDD.scala:125)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:250)
at scala.Option.getOrElse(Option.scala:121)

This make it impossible to use magellan where it is required to have a later version of guava 15+

To solve this we could either use System.getTime or apache commons-lang3 which also provides a StopWatch class. This PR uses commons-lang3 StopWatch to elevate the dependency on guava.

@codecov-io
Copy link

codecov-io commented Jun 12, 2018

Codecov Report

Merging #221 into master will decrease coverage by 0.04%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #221      +/-   ##
==========================================
- Coverage   90.16%   90.11%   -0.05%     
==========================================
  Files          52       52              
  Lines        1789     1791       +2     
  Branches      124      125       +1     
==========================================
+ Hits         1613     1614       +1     
- Misses        176      177       +1
Impacted Files Coverage Δ
...in/scala/magellan/mapreduce/ShapeInputFormat.scala 88.23% <60%> (-2.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa9021e...2587988. Read the comment docs.

@ehsanhaq ehsanhaq changed the title Bump guava version to 17.0 Use apache commons for Stopwatch instead of guava Jun 12, 2018
- Added a provided dependency on commons-lang3 3.5
@ehsanhaq
Copy link
Author

@harsha2010 could you review this PR.

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.

None yet

2 participants