コード例 #1
0
 static {
   if (NativeCodeLoader.isNativeCodeLoaded() && NativeCodeLoader.buildSupportsSnappy()) {
     try {
       initIDs();
       nativeSnappyLoaded = true;
     } catch (Throwable t) {
       LOG.error("failed to load SnappyCompressor", t);
     }
   }
 }
コード例 #2
0
ファイル: ZlibCompressor.java プロジェクト: hmilxin/hadoop
 static {
   if (NativeCodeLoader.isNativeCodeLoaded()) {
     try {
       // Initialize the native library
       initIDs();
       nativeZlibLoaded = true;
     } catch (Throwable t) {
       // Ignore failure to load/initialize native-zlib
     }
   }
 }
コード例 #3
0
 @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);
   }
 }
コード例 #4
0
ファイル: OpensslCipher.java プロジェクト: RiseOfApes/hadoop
 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;
   }
 }
コード例 #5
0
 static {
   if (!NativeCodeLoader.isNativeCodeLoaded()) {
     throw new RuntimeException("Bailing out since native library couldn't " + "be loaded");
   }
   LOG.info("Using JniBasedUnixGroupsMapping for Group resolution");
 }