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

Compression.java different compressions load system classpath differently causing errors

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.99.0
    • 0.99.0, 0.98.3
    • None
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment