4.3. Defining the Business Operations (Processors)

Documentation

VoltDB Home » Documentation » Volt Active Data Active(SP)

4.3. Defining the Business Operations (Processors)

The source and sink define where the stream starts and ends. But it is the processors in the middle that do the real work of transforming the data into actionable business decisions. The processors are executed sequentially as defined in the pipeline definition and can be any function or method you choose. For example, the quick start random-too-kafka-pipeline uses an inline function to convert the text to uppercase:

.processWith(
        string -> string.toUpperCase()
)

For more complex processing, you can include the processor source code separately elsewhere in the pipeline definition file or define and build it as a separate class. But the key advantage of Active(SP) is that it provides built-in methods for integrating common processors using Kafka and Volt Active Data. For example, invoking a Volt stored procedure as a processor is a simple matter of identifying the procedure name and database server:

.processWith(VoltFunctions.<Object[], 
    VoltTable>procedureCall("CountByUser")
       .withHostAndPort("${voltdb.host}", "${voltdb.port}"))