Package io.pravega.connectors.flink.sink
Class PravegaEventSink<T>
- java.lang.Object
-
- io.pravega.connectors.flink.sink.PravegaSink<T>
-
- io.pravega.connectors.flink.sink.PravegaEventSink<T>
-
- Type Parameters:
T
- The type of the event to be written.
- All Implemented Interfaces:
java.io.Serializable
,org.apache.flink.api.connector.sink2.Sink<T>
@Experimental public class PravegaEventSink<T> extends PravegaSink<T>
A Pravega sink forPravegaWriterMode.BEST_EFFORT
andPravegaWriterMode.ATLEAST_ONCE
writer mode.Use
PravegaSinkBuilder
to construct aPravegaEventSink
.PravegaEventWriter
spawned by this sink is the only class responsible for writing all incoming events. In short, it callsEventStreamWriter.writeEvent(Type)
and fails the task if there is an error.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PravegaEventSink(io.pravega.client.ClientConfig clientConfig, io.pravega.client.stream.Stream stream, PravegaWriterMode writerMode, org.apache.flink.api.common.serialization.SerializationSchema<T> serializationSchema, PravegaEventRouter<T> eventRouter)
Creates a new Pravega Event Sink instance which can be added as a sink to a Flink job.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.connector.sink2.SinkWriter<T>
createWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context)
-
Methods inherited from class io.pravega.connectors.flink.sink.PravegaSink
builder
-
-
-
-
Constructor Detail
-
PravegaEventSink
public PravegaEventSink(io.pravega.client.ClientConfig clientConfig, io.pravega.client.stream.Stream stream, PravegaWriterMode writerMode, org.apache.flink.api.common.serialization.SerializationSchema<T> serializationSchema, PravegaEventRouter<T> eventRouter)
Creates a new Pravega Event Sink instance which can be added as a sink to a Flink job. It will create aPravegaEventWriter
on demand with following parameters. We can usePravegaSinkBuilder
to build such a sink.- Parameters:
clientConfig
- The Pravega client configuration.stream
- The destination stream.writerMode
- The writer mode of the sink.serializationSchema
- The implementation for serializing every event into pravega's storage format.eventRouter
- The implementation to extract the partition key from the event.
-
-
Method Detail
-
createWriter
public org.apache.flink.api.connector.sink2.SinkWriter<T> createWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
-