@PublicEvolving public class JsonSerializationSchema<T> extends Object implements SerializationSchema<T>
SerializationSchema.InitializationContext
Modifier and Type | Field and Description |
---|---|
protected org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper |
mapper |
Constructor and Description |
---|
JsonSerializationSchema() |
JsonSerializationSchema(SerializableSupplier<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper> mapperFactory) |
Modifier and Type | Method and Description |
---|---|
void |
open(SerializationSchema.InitializationContext context)
Initialization method for the schema.
|
byte[] |
serialize(T element)
Serializes the incoming element to a specified type.
|
protected transient org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper mapper
public JsonSerializationSchema()
public JsonSerializationSchema(SerializableSupplier<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper> mapperFactory)
public void open(SerializationSchema.InitializationContext context)
SerializationSchema
SerializationSchema.serialize(Object)
and thus suitable for one time setup work.
The provided SerializationSchema.InitializationContext
can be used to access additional features such
as e.g. registering user metrics.
open
in interface SerializationSchema<T>
context
- Contextual information that can be used during initialization.public byte[] serialize(T element)
SerializationSchema
serialize
in interface SerializationSchema<T>
element
- The incoming element to be serializedCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.