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

Print stack trace when native bzip2 library does not load

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • io
    • None

    Description

      When I ran hadoop checknative on my machine, it was not able to load system bzip2 library and printed the following message.

      17/06/02 09:25:42 WARN bzip2.Bzip2Factory: Failed to load/initialize native-bzip2 library system-native, will use pure-Java version

      Reviewing the relevant code, it fails because of an exception. However, that exception is not logged. We should print the stacktrace, at least at debug log level.

      Bzip2Factory#isNativeBzip2Loaded()
      try {
                // Initialize the native library.
                Bzip2Compressor.initSymbols(libname);
                Bzip2Decompressor.initSymbols(libname);
                nativeBzip2Loaded = true;
                LOG.info("Successfully loaded & initialized native-bzip2 library " +
                         libname);
              } catch (Throwable t) {
                LOG.warn("Failed to load/initialize native-bzip2 library " + 
                         libname + ", will use pure-Java version");
              }
      

      Attachments

        1. HADOOP-14481.001.patch
          0.8 kB
          Wei-Chiu Chuang

        Activity

          People

            weichiu Wei-Chiu Chuang
            weichiu Wei-Chiu Chuang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: