public class KafkaEventSchema extends Object implements DeserializationSchema<KafkaEvent>, SerializationSchema<KafkaEvent>
KafkaEvent
type. This class defines how to transform a
Kafka record's bytes to a KafkaEvent
, and vice-versa.Constructor and Description |
---|
KafkaEventSchema() |
Modifier and Type | Method and Description |
---|---|
KafkaEvent |
deserialize(byte[] message)
Deserializes the byte message.
|
TypeInformation<KafkaEvent> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
boolean |
isEndOfStream(KafkaEvent nextElement)
Method to decide whether the element signals the end of the stream.
|
byte[] |
serialize(KafkaEvent event)
Serializes the incoming element to a specified type.
|
public byte[] serialize(KafkaEvent event)
SerializationSchema
serialize
in interface SerializationSchema<KafkaEvent>
event
- The incoming element to be serializedpublic KafkaEvent deserialize(byte[] message) throws IOException
DeserializationSchema
deserialize
in interface DeserializationSchema<KafkaEvent>
message
- The message, as a byte array.IOException
public boolean isEndOfStream(KafkaEvent nextElement)
DeserializationSchema
isEndOfStream
in interface DeserializationSchema<KafkaEvent>
nextElement
- The element to test for the end-of-stream signal.public TypeInformation<KafkaEvent> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<KafkaEvent>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.