Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9658

SnappyCodec#checkNativeCodeLoaded may unexpectedly fail when native code is not loaded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 2.7.1, 3.0.0-alpha1
    • None
    • None
    • Reviewed

    Description

        public static void checkNativeCodeLoaded() {
            if (!NativeCodeLoader.buildSupportsSnappy()) {
              throw new RuntimeException("native snappy library not available: " +
                  "this version of libhadoop was built without " +
                  "snappy support.");
            }
            if (!SnappyCompressor.isNativeCodeLoaded()) {
              throw new RuntimeException("native snappy library not available: " +
                  "SnappyCompressor has not been loaded.");
            }
            if (!SnappyDecompressor.isNativeCodeLoaded()) {
              throw new RuntimeException("native snappy library not available: " +
                  "SnappyDecompressor has not been loaded.");
            }
        }
      

      buildSupportsSnappy is native method. If the native code is not loaded, the method will be missing. Therefore, whether the native code is loaded or not, the first runtime exception will not be thrown.

      Attachments

        1. HADOOP-9658.1.patch
          0.9 kB
          Zhijie Shen

        Issue Links

          Activity

            People

              zjshen Zhijie Shen
              zjshen Zhijie Shen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: