Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-11259

Compression.java different compressions load system classpath differently causing errors

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.99.0
    • Fix Version/s: 0.99.0, 0.98.3
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      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.

        Attachments

        1. HBASE-11259.patch
          1 kB
          Enoch Hsu

          Activity

            People

            • Assignee:
              enhs8920 Enoch Hsu
              Reporter:
              enhs8920 Enoch Hsu
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: