Example #1
0
 static {
   if (NativeCodeLoader.isNativeCodeLoaded() && NativeCodeLoader.buildSupportsSnappy()) {
     try {
       initIDs();
       nativeSnappyLoaded = true;
     } catch (Throwable t) {
       LOG.error("failed to load SnappyCompressor", t);
     }
   }
 }
Example #2
0
 static {
   if (NativeCodeLoader.isNativeCodeLoaded()) {
     try {
       // Initialize the native library
       initIDs();
       nativeZlibLoaded = true;
     } catch (Throwable t) {
       // Ignore failure to load/initialize native-zlib
     }
   }
 }
 @Test
 public void testZlibDirectCompressDecompress() {
   int[] size = {1, 4, 16, 4 * 1024, 64 * 1024, 128 * 1024, 1024 * 1024};
   assumeTrue(NativeCodeLoader.isNativeCodeLoaded());
   try {
     for (int i = 0; i < size.length; i++) {
       compressDecompressLoop(size[i]);
     }
   } catch (IOException ex) {
     fail("testZlibDirectCompressDecompress ex !!!" + ex);
   }
 }
Example #4
0
 static {
   String loadingFailure = null;
   try {
     if (!NativeCodeLoader.buildSupportsOpenssl()) {
       loadingFailure = "build does not support openssl.";
     } else {
       initIDs();
     }
   } catch (Throwable t) {
     loadingFailure = t.getMessage();
     LOG.debug("Failed to load OpenSSL Cipher.", t);
   } finally {
     loadingFailureReason = loadingFailure;
   }
 }
 static {
   if (!NativeCodeLoader.isNativeCodeLoaded()) {
     throw new RuntimeException("Bailing out since native library couldn't " + "be loaded");
   }
   LOG.info("Using JniBasedUnixGroupsMapping for Group resolution");
 }