Enum Class CompressionType

java.lang.Object
java.lang.Enum<CompressionType>
org.apache.pulsar.client.api.v5.config.CompressionType
All Implemented Interfaces:
Serializable, Comparable<CompressionType>, Constable

public enum CompressionType extends Enum<CompressionType>
Compression codec used for message payloads.
  • Enum Constant Details

    • NONE

      public static final CompressionType NONE
      No compression. Lowest CPU cost but highest bandwidth and storage usage.
    • LZ4

      public static final CompressionType LZ4
      LZ4 compression. Very fast compression and decompression with moderate compression ratio. A good general-purpose default for latency-sensitive and CPU-sensitive workloads.
    • ZLIB

      public static final CompressionType ZLIB
      ZLIB compression. Higher compression ratio than LZ4 but significantly slower. Prefer ZSTD which achieves better compression ratios with faster performance.
    • ZSTD

      public static final CompressionType ZSTD
      Zstandard compression. Best compression ratio of all options with decompression speed close to LZ4. Recommended for throughput and storage-optimized workloads.
    • SNAPPY

      public static final CompressionType SNAPPY
      Snappy compression. Very fast with a compression profile similar to LZ4. Useful for compatibility with ecosystems that standardize on Snappy.
  • Method Details

    • values

      public static CompressionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CompressionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null