Class Lz4TransportDecompressor

org.elasticsearch.transport.Lz4TransportDecompressor
All Implemented Interfaces:
, , org.elasticsearch.core.Releasable, TransportDecompressor

public class Lz4TransportDecompressor extends implements TransportDecompressor
This file is forked from the https://netty.io project. In particular it forks the following file io.netty.handler.codec.compression.Lz4FrameDecoder. It modifies the original netty code to operate on byte arrays opposed to ByteBufs. Additionally, it integrates the decompression code to work in the Elasticsearch transport pipeline, Finally, it replaces the custom Netty decoder exceptions. This class is necessary as Netty is not a dependency in Elasticsearch server module.
  • Constructor Details

    • Lz4TransportDecompressor

      public Lz4TransportDecompressor(PageCacheRecycler recycler)
  • Method Details

    • pollDecompressedPage

      public ReleasableBytesReference pollDecompressedPage(boolean isEOS)
      Specified by:
      pollDecompressedPage in interface TransportDecompressor
    • close

      public void close()
      Specified by:
       in interface 
      Specified by:
       in interface 
      Specified by:
      close in interface org.elasticsearch.core.Releasable
      Specified by:
      close in interface TransportDecompressor
    • decompress

      public int decompress(BytesReference bytesReference) throws
      Description copied from interface: TransportDecompressor
      Decompress the provided bytes
      Specified by:
      decompress in interface TransportDecompressor
      Parameters:
      bytesReference - to decompress
      Returns:
      number of compressed bytes consumed
      Throws:
    • isClosed

      public boolean isClosed()
      Returns true if and only if the end of the compressed stream has been reached.