There are a number of different places jar files originate during execution of a transformation in the AEL engine:
- The set of jars in data-integration/lib
- Jars from spark-install/jars
- Jars from the hadoop classpath
- AEL jars in Karaf
- Jars from kettle plugins (OSGi and otherwise)
Library versions contained in these different locations can and will conflict in some cases. This can cause general problems where spark libraries conflict with hadoop libraries . It also has the potential to create AEL specific problems .
Several bugs have arisen because of library conflicts, both within AEL code and from Spark generally:
OSGi is valuable specifically because it deals with these sorts of problems, and luckily most of AEL execution happens within Karaf. The places where we're vulnerable, however, are:
- Execution which occurs outside of the engine, not leveraging karaf (like SparkWebSocketMain).
- The set of packages specified by org.osgi.framework.system.packages.extra (from karaf/etc/custom.properties). That is, the set of packages exposed from the framework classloader.
As of Pentaho 8.0, running AEL with Spark 2.1.0, the set of jars in conflict between spark-install/jars and data-integration/lib are the following 24 libraries:
Of these, the set of packages exposed from the framework classloader boil down to these packages:
Since these packages are provided via the framework classloader, and are loaded from indeterminate lib versions, there's inherent risk that undesired and unpredictable behavior could result.
- Test specific Spark and Hadoop versions and recommend sticking to that set.
- Minimize usage of classes within the above packages. Update the list of potentially conflicting packages as new releases come out.
- Wherever possible, leverage classes injected via blueprint within AEL.
- Avoid usage of libraries that overlap with hadoop / spark libraries for any packages retrieved via the framework classloader.