Module org.elasticsearch.xcore
Class InferenceToXContentCompressor
java.lang.Object
org.elasticsearch.xpack.core.ml.inference.InferenceToXContentCompressor
Collection of helper methods. Similar to CompressedXContent, but this utilizes GZIP for parity with the native compression
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.elasticsearch.xcontent.ToXContentObject>
BytesReferencedeflate(T objectToCompress) static <T> Tinflate(BytesReference compressedBytes, org.elasticsearch.core.CheckedFunction<org.elasticsearch.xcontent.XContentParser, T, IOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) static <T> TinflateUnsafe(BytesReference compressedBytes, org.elasticsearch.core.CheckedFunction<org.elasticsearch.xcontent.XContentParser, T, IOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry)
-
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, throws IOExceptionIOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) - Throws:
IOException
-
inflate
public static <T> T inflate(BytesReference compressedBytes, org.elasticsearch.core.CheckedFunction<org.elasticsearch.xcontent.XContentParser, T, throws IOExceptionIOException> parserFunction, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) - Throws:
IOException
-