org.apache.hadoop.hbase.io.hfile.HFile.getSupportedCompressionAlgorithms()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.hadoop.hbase.io.hfile.HFile.getSupportedCompressionAlgorithms()方法的一些代码示例,展示了HFile.getSupportedCompressionAlgorithms()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HFile.getSupportedCompressionAlgorithms()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.io.hfile.HFile
类名称:HFile
方法名:getSupportedCompressionAlgorithms

HFile.getSupportedCompressionAlgorithms介绍

[英]Get names of supported compression algorithms. The names are acceptable by HFile.Writer.
[中]

代码示例

代码示例来源:origin: apache/hbase

/**
 * Get supported compression algorithms.
 * @return supported compression algorithms.
 */
public static Compression.Algorithm[] getSupportedCompressionAlgorithms() {
 String[] allAlgos = HFile.getSupportedCompressionAlgorithms();
 List<Compression.Algorithm> supportedAlgos = new ArrayList<>();
 for (String algoName : allAlgos) {
  try {
   Compression.Algorithm algo = Compression.getCompressionAlgorithmByName(algoName);
   algo.getCompressor();
   supportedAlgos.add(algo);
  } catch (Throwable t) {
   // this algo is not available
  }
 }
 return supportedAlgos.toArray(new Algorithm[supportedAlgos.size()]);
}

代码示例来源:origin: NGDATA/lilyproject

/**
   * Get supported compression algorithms.
   *
   * @return supported compression algorithms.
   */
  public static Compression.Algorithm[] getSupportedCompressionAlgorithms() {
    String[] allAlgos = HFile.getSupportedCompressionAlgorithms();
    List<Compression.Algorithm> supportedAlgos = new ArrayList<Compression.Algorithm>();
    for (String algoName : allAlgos) {
      try {
        Compression.Algorithm algo = Compression.getCompressionAlgorithmByName(algoName);
        algo.getCompressor();
        supportedAlgos.add(algo);
      } catch (Throwable t) {
        // this algo is not available
      }
    }
    return supportedAlgos.toArray(new Compression.Algorithm[0]);
  }
}

代码示例来源:origin: org.apache.hbase/hbase-server

/**
 * Get supported compression algorithms.
 * @return supported compression algorithms.
 */
public static Compression.Algorithm[] getSupportedCompressionAlgorithms() {
 String[] allAlgos = HFile.getSupportedCompressionAlgorithms();
 List<Compression.Algorithm> supportedAlgos = new ArrayList<>();
 for (String algoName : allAlgos) {
  try {
   Compression.Algorithm algo = Compression.getCompressionAlgorithmByName(algoName);
   algo.getCompressor();
   supportedAlgos.add(algo);
  } catch (Throwable t) {
   // this algo is not available
  }
 }
 return supportedAlgos.toArray(new Algorithm[supportedAlgos.size()]);
}

相关文章