HBASE-11259 Compression.java different compressions load system classpath differently causing errors (Enoch Hsu)
This commit is contained in:
parent
8c7772488c
commit
8c14c7b5bb
|
@ -123,8 +123,7 @@ public final class Compression {
|
||||||
private CompressionCodec buildCodec(Configuration conf) {
|
private CompressionCodec buildCodec(Configuration conf) {
|
||||||
try {
|
try {
|
||||||
Class<?> externalCodec =
|
Class<?> externalCodec =
|
||||||
ClassLoader.getSystemClassLoader()
|
getClassLoaderForCodec().loadClass("com.hadoop.compression.lzo.LzoCodec");
|
||||||
.loadClass("com.hadoop.compression.lzo.LzoCodec");
|
|
||||||
return (CompressionCodec) ReflectionUtils.newInstance(externalCodec,
|
return (CompressionCodec) ReflectionUtils.newInstance(externalCodec,
|
||||||
new Configuration(conf));
|
new Configuration(conf));
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
@ -208,8 +207,7 @@ public final class Compression {
|
||||||
private CompressionCodec buildCodec(Configuration conf) {
|
private CompressionCodec buildCodec(Configuration conf) {
|
||||||
try {
|
try {
|
||||||
Class<?> externalCodec =
|
Class<?> externalCodec =
|
||||||
ClassLoader.getSystemClassLoader()
|
getClassLoaderForCodec().loadClass("org.apache.hadoop.io.compress.SnappyCodec");
|
||||||
.loadClass("org.apache.hadoop.io.compress.SnappyCodec");
|
|
||||||
return (CompressionCodec) ReflectionUtils.newInstance(externalCodec,
|
return (CompressionCodec) ReflectionUtils.newInstance(externalCodec,
|
||||||
conf);
|
conf);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
|
Loading…
Reference in New Issue