All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.parquet.format.CompressionCodec Maven / Gradle / Ivy

/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.parquet.format;


import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;

/**
 * Supported compression algorithms.
 * 
 * Codecs added in 2.3.2 can be read by readers based on 2.3.2 and later.
 * Codec support may vary between readers based on the format version and
 * libraries available at runtime. Gzip, Snappy, and LZ4 codecs are
 * widely available, while Zstd and Brotli require additional libraries.
 */
public enum CompressionCodec implements org.apache.thrift.TEnum {
  UNCOMPRESSED(0),
  SNAPPY(1),
  GZIP(2),
  LZO(3),
  BROTLI(4),
  LZ4(5),
  ZSTD(6);

  private final int value;

  private CompressionCodec(int value) {
    this.value = value;
  }

  /**
   * Get the integer value of this enum value, as defined in the Thrift IDL.
   */
  public int getValue() {
    return value;
  }

  /**
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
   * @return null if the value is not found.
   */
  public static CompressionCodec findByValue(int value) { 
    switch (value) {
      case 0:
        return UNCOMPRESSED;
      case 1:
        return SNAPPY;
      case 2:
        return GZIP;
      case 3:
        return LZO;
      case 4:
        return BROTLI;
      case 5:
        return LZ4;
      case 6:
        return ZSTD;
      default:
        return null;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy