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
Removes guava dependency #72
Removes guava dependency #72
Conversation
Guava leads to library conflicts and interoperability problems. By removing the guava dep, we can more safely be placed in core libraries. Instead of forcing users to use or convert out of Guava's optional, we now use nullable. Nullable is trivial to convert to an optional type in the caller's favorite functional library or language.
@adriancole Thanks for doing this! I was actually planning on removing guava and apache commons soon. Did you notice that a few days ago I did some commits which are merged to master that upgrade Java source and target to 1.8? Because we are using Java 1.8 now I would propose to migrate to Java 8 I think lots of users will be thankful that you tackle removing guava. |
@kristofa Thanks for the quick feedback. Here's my unacclimated 2p on the Java 8 question. We should be cautious with using java Optional (and in fact consider moving source back to target 1.7). Few who use non-java languages or alternate functional libraries will be able to leverage java 8 Optional for some time, and it will be more of a chore to them than nullable. For example, in order to use brave, they may have to upgrade the root of their dependency tree! Unless the source level of java 8 is strategic to us, I think it best to revert it to 7 (and add animal sniffer which I can help with). We can still build/test/run with JDK 8, but I think sticking on java 7 for some time will help adoption. Android (even if not explicitly targeted) is ruled out with Java 8, so are scala 2.10 users who aren't using finagle. Some of our integrations could move to java 8, but I think the core should stick to java 7 source level. |
Removing guava is a fantastic move! Sticking with Java7 also gets my vote. Being a compile-time library that falls in the "infrastructure components" category for any microservices platform, that is where the value of brave/zipkin is in having it everywhere in such a platform, would mean expecting often hundreds of services and applications to all be Java8 compatible before brave-3 can be considered an option. When is Apache commons a problem? ( libthrift is already dependent on commons-lang3-3.1 ) |
@michaelsembwever thx for the feedback. I would like us to be able to not maintain 2 forks in order to progress brave-3 as well! wrt commons and libthrift: I feel like libthrift is just an implementation of thrift, and I'd rather decouple our use of commons from our use of libthrift. For example, I've come very close to writing square wire thrift integration a couple times now :) I've also thought about what ifs for protobuf as opposed to only thrift. Practically speaking, I concede this is mostly pie-in-sky and we'd likely continue to have this as transitive for the foreseeable future.. That said, even if that's the case, if we don't commons directly, we don't need to track it vs what libthrift uses. One less thing to deal with. wrt commons on its own: I've no specific beef with apache commons except that it is a dependency that doesn't add much value (ex. our use of it would be maybe <100loc to copy or reproduce). If we have no apache commons dep, we have no need to track it and neither would our callers. It is a benign dep, I admit, but again, rather not think about it at all. |
Thanks for the input @adriancole and @michaelsembwever. You convinced me, I'll downgrade to Java 7. I'll have to rework some code I wrote earlier this week though which use Java 8 I also think it should not be too difficult to remove apache commons dependency from brave itself. As far as I can remember we use |
Whoot! So is this mergable? Regardless, I can raise another PR to downgrade
and add animal sniffer.
|
It is a little sad that we make the code less safe by removing the usage of I never used animal sniffer Maven plugin before. Looks useful. Feel free to submit a pr :) The code in which I introduced Java 8 |
Thanks for the pointers! Here's my plan with internal maintenance. All of which I can do all the work except review on. I understand all of which also have implications on in-flight work.
I understand that while I'm quite familiar and comfortable with above, they may not be universally liked. That said, I appreciate keeping an open mind. If such pull requests don't end up acceptable.. well it was worth a shot! |
Guava leads to library conflicts and interoperability problems. By
removing the guava dep, we can more safely be placed in core libraries.
Instead of forcing users to use or convert out of Guava's optional, we
now use nullable. Nullable is trivial to convert to an optional type in
the caller's favorite functional library or language.