Using different versions of same library

164 views Asked by At

I've lately upgraded my Cassandra nodes from version 1.0.11 to version 2.1.8. Version 1.0.11 uses Hector Java Driver, which isn't supported anymore, whereas for v.2.1.8, we are using Native CQL Driver.

When I've added the libraries for the new version, I've encountered a serious problem with Guava library:

  • Hector Driver - works with (legacy) guava-r09.jar.
  • Native CQL Driver - works with guava-18.0.jar.

So, I tried to remove the old Guava jar (v.09) and replace it with the new one (v.18), but it's not compliant with Hector, since Hector is pretty much deprecated for a while and is not compatible with newer versions of anything.

On the other hand, Native CQL driver won't work with Guava versions lower than v.18. And of course, both together will crash the whole system since many functions will override each other.

Some possible solutions I've been thinking about are:

  1. Migrating our whole project to new Driver - this is a solution but it will take ages, since we've got a lot of complex code.
  2. Deep digging into Hector Classes and manually changing them to be compatible with v.18 - This is another solution, but it will take time and be very risky. Besides, each Guava update I'll need to do modifications which may possibly take much time.
  3. Two parallel apps? Can't really figure this one...

Does anyone have any other easier suggestions? Like some sort of selective library version for one query and a different version for others? Maybe some sort of Docker? or perhaps a Virtual Env solution?

Thanks in advance, Adam.

0

There are 0 answers