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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 2.7.1, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: