Class Bzip2DecompressionCodec

java.lang.Object
org.elasticsearch.xpack.esql.datasource.bzip2.Bzip2DecompressionCodec
All Implemented Interfaces:
DecompressionCodec, SplittableDecompressionCodec

public class Bzip2DecompressionCodec extends Object implements SplittableDecompressionCodec
Bzip2 decompression codec with splittable support for parallel decompression.

Uses a forked Hadoop-style CBZip2InputStream in BYBLOCK mode for split decompression. The decompressor handles bit-aligned block boundaries natively via skipToNextMarker(), avoiding the need for byte-aligned block offsets.

For split decompression, the stream is positioned at the byte containing the block marker. The CBZip2InputStream in BYBLOCK mode finds the exact bit position, decompresses one block at a time, and reports compressed byte positions at block boundaries. A wrapper monitors these positions and signals EOF when the decompressor passes the split boundary.