Java 类org.apache.hadoop.io.compress.snappy.LoadSnappy 实例源码

项目:presto-hadoop-apache1    文件:HadoopNative.java   
public static synchronized void requireHadoopNative()
{
    if (loaded) {
        return;
    }
    if (error != null) {
        throw new RuntimeException("failed to load Hadoop native library", error);
    }
    try {
        loadLibrary("hadoop");
        loadLibrary("snappy");
        setStatic(NativeCodeLoader.class.getDeclaredField("nativeCodeLoaded"), true);
        setStatic(LoadSnappy.class.getDeclaredField("AVAILABLE"), true);
        setStatic(LoadSnappy.class.getDeclaredField("LOADED"), true);

        // verify that all configured codec classes can be loaded
        loadAllCodecs();

        loaded = true;
    }
    catch (Throwable t) {
        error = t;
        throw new RuntimeException("failed to load Hadoop native library", error);
    }
}
项目:hadoop-on-lustre    文件:TestCodec.java   
public void testSnappyCodec() throws IOException {
  if (LoadSnappy.isAvailable()) {
    if (LoadSnappy.isLoaded()) {
      codecTest(conf, seed, 0, "org.apache.hadoop.io.compress.SnappyCodec");
      codecTest(conf, seed, count, "org.apache.hadoop.io.compress.SnappyCodec");
    }
    else {
      fail("Snappy native available but Hadoop native not");
    }
  }
}
项目:hortonworks-extension    文件:TestCodec.java   
public void testSnappyCodec() throws IOException {
  if (LoadSnappy.isAvailable()) {
    if (LoadSnappy.isLoaded()) {
      codecTest(conf, seed, 0, "org.apache.hadoop.io.compress.SnappyCodec");
      codecTest(conf, seed, count, "org.apache.hadoop.io.compress.SnappyCodec");
    }
    else {
      fail("Snappy native available but Hadoop native not");
    }
  }
}
项目:hortonworks-extension    文件:TestCodec.java   
public void testSnappyCodec() throws IOException {
  if (LoadSnappy.isAvailable()) {
    if (LoadSnappy.isLoaded()) {
      codecTest(conf, seed, 0, "org.apache.hadoop.io.compress.SnappyCodec");
      codecTest(conf, seed, count, "org.apache.hadoop.io.compress.SnappyCodec");
    }
    else {
      fail("Snappy native available but Hadoop native not");
    }
  }
}
项目:hadoop-EAR    文件:SnappyCodec.java   
/**
 * Are the native snappy libraries loaded & initialized?
 *
 * @param conf
 *            configuration
 * @return true if loaded & initialized, otherwise false
 */
public static boolean isNativeSnappyLoaded(Configuration conf) {
  return LoadSnappy.isLoaded();
}
项目:hadoop-on-lustre    文件:SnappyCodec.java   
/**
 * Are the native snappy libraries loaded & initialized?
 *
 * @param conf configuration
 * @return true if loaded & initialized, otherwise false
 */
public static boolean isNativeSnappyLoaded(Configuration conf) {
  return LoadSnappy.isLoaded() && conf.getBoolean(
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY,
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_DEFAULT);
}
项目:RDFS    文件:SnappyCodec.java   
/**
 * Are the native snappy libraries loaded & initialized?
 *
 * @param conf
 *            configuration
 * @return true if loaded & initialized, otherwise false
 */
public static boolean isNativeSnappyLoaded(Configuration conf) {
  return LoadSnappy.isLoaded();
}
项目:hortonworks-extension    文件:SnappyCodec.java   
/**
 * Are the native snappy libraries loaded & initialized?
 *
 * @param conf configuration
 * @return true if loaded & initialized, otherwise false
 */
public static boolean isNativeSnappyLoaded(Configuration conf) {
  return LoadSnappy.isLoaded() && conf.getBoolean(
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY,
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_DEFAULT);
}
项目:hortonworks-extension    文件:SnappyCodec.java   
/**
 * Are the native snappy libraries loaded & initialized?
 *
 * @param conf configuration
 * @return true if loaded & initialized, otherwise false
 */
public static boolean isNativeSnappyLoaded(Configuration conf) {
  return LoadSnappy.isLoaded() && conf.getBoolean(
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY,
      CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_DEFAULT);
}