Class EventDeSerializationSchema
- java.lang.Object
-
- org.apache.flink.streaming.examples.statemachine.kafka.EventDeSerializationSchema
-
- All Implemented Interfaces:
Serializable
,DeserializationSchema<Event>
,SerializationSchema<Event>
,ResultTypeQueryable<Event>
public class EventDeSerializationSchema extends Object implements DeserializationSchema<Event>, SerializationSchema<Event>
A serializer and deserializer for theEvent
type.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
DeserializationSchema.InitializationContext
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
SerializationSchema.InitializationContext
-
-
Constructor Summary
Constructors Constructor Description EventDeSerializationSchema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Event
deserialize(byte[] message)
Deserializes the byte message.TypeInformation<Event>
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.boolean
isEndOfStream(Event nextElement)
Method to decide whether the element signals the end of the stream.byte[]
serialize(Event evt)
Serializes the incoming element to a specified type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
deserialize, open
-
Methods inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
open
-
-
-
-
Method Detail
-
serialize
public byte[] serialize(Event evt)
Description copied from interface:SerializationSchema
Serializes the incoming element to a specified type.- Specified by:
serialize
in interfaceSerializationSchema<Event>
- Parameters:
evt
- The incoming element to be serialized- Returns:
- The serialized element.
-
deserialize
public Event deserialize(byte[] message) throws IOException
Description copied from interface:DeserializationSchema
Deserializes the byte message.- Specified by:
deserialize
in interfaceDeserializationSchema<Event>
- Parameters:
message
- The message, as a byte array.- Returns:
- The deserialized message as an object (null if the message cannot be deserialized).
- Throws:
IOException
-
isEndOfStream
public boolean isEndOfStream(Event nextElement)
Description copied from interface:DeserializationSchema
Method to decide whether the element signals the end of the stream. If true is returned the element won't be emitted.- Specified by:
isEndOfStream
in interfaceDeserializationSchema<Event>
- Parameters:
nextElement
- The element to test for the end-of-stream signal.- Returns:
- True, if the element signals end of stream, false otherwise.
-
getProducedType
public TypeInformation<Event> getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable<Event>
- Returns:
- The data type produced by this function or input format.
-
-