AnsweredAssumed Answered

Trying to enable LZO-compressed table causes class loading error

Question asked by tc_dev on Apr 29, 2012
I have an LZO-compressed table which I disabled for testing purposes. When trying to enable it back (from HBase shell) the operation fails with the following message in the log:

    2012-04-30 01:15:45,362 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Received request to open region: weblog,,1332138688550.c9a0df28af30d46fc6cf7ebbca48c7b6.
    2012-04-30 01:15:45,368 ERROR org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler: Failed open of region=weblog,,1332138688550.c9a0df28af30d46fc6cf7ebbca48c7b6.
    java.io.IOException: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.hadoop.compression.lzo.LzoCodec
        at org.apache.hadoop.hbase.util.CompressionTest.testCompression(CompressionTest.java:89)
        at org.apache.hadoop.hbase.regionserver.HRegion.checkCompressionCodecs(HRegion.java:2573)
        at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2562)
        at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2550)
        at org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler.openRegion(OpenRegionHandler.java:272)
        at org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler.process(OpenRegionHandler.java:99)
        at org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:156)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.hadoop.compression.lzo.LzoCodec
        at org.apache.hadoop.hbase.io.hfile.Compression$Algorithm$1.getCodec(Compression.java:92)
        at org.apache.hadoop.hbase.io.hfile.Compression$Algorithm.getCompressor(Compression.java:197)
        at org.apache.hadoop.hbase.util.CompressionTest.testCompression(CompressionTest.java:84)
        ... 9 more
    Caused by: java.lang.ClassNotFoundException: com.hadoop.compression.lzo.LzoCodec
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at org.apache.hadoop.hbase.io.hfile.Compression$Algorithm$1.getCodec(Compression.java:87)
        ... 11 more
    2012-04-30 03:03:29,567 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Received request to open region: mytable,,1335780209485.0378717c656eadd185fc57974eb94ca8.
    2012-04-30 03:03:29,573 ERROR org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler: Failed open of region=mytable,,1335780209485.0378717c656eadd185fc57974eb94ca8.
    java.io.IOException: Compression algorithm 'lzo' previously failed test.
        at org.apache.hadoop.hbase.util.CompressionTest.testCompression(CompressionTest.java:78)
        at org.apache.hadoop.hbase.regionserver.HRegion.checkCompressionCodecs(HRegion.java:2573)
        at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2562)
        at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2550)
        at org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler.openRegion(OpenRegionHandler.java:272)
        at org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler.process(OpenRegionHandler.java:99)
        at org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:156)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

        
After getting this error I verified again that LZO is present by creating a dummy table with LZO column family, which went fine despite LZO dependency.

    create 'mytable', {NAME=>'colfam', COMPRESSION=>'lzo'}

What would you suggest for troubleshooting LZO class loading issues from HBase shell and beyond?

Outcomes