Description
I stumbled upon this issue when testing Snappy compression on hbase tables with a webserver.
On the webserver the system classpath of the server JVM did not include the path to hadoop-common.jar and since it is hardcoded to only retrieve the system classpath it ran into a NoClassDefFoundException using hte following call ClassLoader.getSystemClassLoader()
However LZ4 compression works using this private method getClassLoaderForCodec() which attempts to load the threads classpath first and the system classpath last.
I propose to change all the ClassLoader.getSystemClassLoader() calls to getClassLoaderForCodec() to allow for consistent behavior in loading compression classes and to also make it easier for users to make sure they do not run into RuntimeExceptions.