package flink
Ordering
- Alphabetic
Visibility
- Public
- All
Type Members
-
abstract
class
FlinkStreamlet extends Streamlet[FlinkStreamletContext] with Serializable
The base class for defining Flink streamlets.
The base class for defining Flink streamlets. Derived classes need to override
createLogic
to provide the custom implementation for the behavior of the streamlet.Here's an example:
// new custom `FlinkStreamlet` class MyFlinkProcessor extends FlinkStreamlet { // Step 1: Define inlets and outlets. Note for the outlet you can specify // the partitioner function explicitly or else `RoundRobinPartitioner` // will be used val in = AvroInlet[Data]("in") val out = AvroOutlet[Simple]("out", _.name) // Step 2: Define the shape of the streamlet. In this example the streamlet // has 1 inlet and 1 outlet val shape = StreamletShape(in, out) // Step 3: Provide custom implementation of `FlinkStreamletLogic` that defines // the behavior of the streamlet override def createLogic() = new FlinkStreamletLogic { override def executeStreamingQueries = { val outStream: DataStream[Simple] = writeStream( readStream(in).map(r => Simple(r.name)), out ) executionEnv.execute() } } }
-
abstract
case class
FlinkStreamletContext(streamletDefinition: StreamletDefinition, env: StreamExecutionEnvironment) extends StreamletContext with Product with Serializable
Runtime context for FlinkStreamlets
-
class
FlinkStreamletContextImpl extends FlinkStreamletContext
An implementation of
FlinkStreamletContext
-
abstract
class
FlinkStreamletLogic extends StreamletLogic[FlinkStreamletContext]
Provides an entry-point for defining the behavior of a FlinkStreamlet.
Provides an entry-point for defining the behavior of a FlinkStreamlet. Overide the method
buildExecutionGraph
to build the computation graph that needs to run as part of the business logic for theFlinkStreamlet
.Here's an example of how to provide a specialized implementation of
FlinkStreamletLogic
as part of implementing a customFlinkStreamlet
:// new custom `FlinkStreamlet` // define inlets, outlets and shape // provide custom implementation of `FlinkStreamletLogic` override def createLogic() = new FlinkStreamletLogic { override def buildExecutionGraph = { val ins: DataStream[Data] = readStream(in) val simples: DataStream[Simple] = ins.map(r => new Simple(r.getName())) writeStream(out, simples) } } }
Value Members
- object FlinkStreamletRuntime extends StreamletRuntime with Product with Serializable