Packages

package flink

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. 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()
        }
      }
    }
  2. abstract case class FlinkStreamletContext(streamletDefinition: StreamletDefinition, env: StreamExecutionEnvironment) extends StreamletContext with Product with Serializable

    Runtime context for FlinkStreamlets

  3. class FlinkStreamletContextImpl extends FlinkStreamletContext

    An implementation of FlinkStreamletContext

  4. 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 the FlinkStreamlet.

    Here's an example of how to provide a specialized implementation of FlinkStreamletLogic as part of implementing a custom FlinkStreamlet:

      // 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

  1. object FlinkStreamletRuntime extends StreamletRuntime with Product with Serializable

Ungrouped