Class InferenceToXContentCompressor

java.lang.Object
org.elasticsearch.xpack.core.ml.inference.InferenceToXContentCompressor

public final class InferenceToXContentCompressor extends Object
Collection of helper methods. Similar to CompressedXContent, but this utilizes GZIP for parity with the native compression
  • Method Details

    • deflate

      public static <T extends org.elasticsearch.xcontent.ToXContentObject> BytesReference deflate(T objectToCompress) throws IOException
      Throws:
      IOException
    • inflateUnsafe

      public static <T> T inflateUnsafe(BytesReference compressedBytes, org.elasticsearch.core.CheckedFunction<org.elasticsearch.xcontent.XContentParser,T,IOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) throws IOException
      Throws:
      IOException
    • inflate

      public static <T> T inflate(BytesReference compressedBytes, org.elasticsearch.core.CheckedFunction<org.elasticsearch.xcontent.XContentParser,T,IOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) throws IOException
      Throws:
      IOException