AddBolt: Function to add a 'Bolt' to a 'Topology' object to specify a...

Description Usage Arguments Value Warning Author(s) See Also Examples

View source: R/topology.R

Description

AddBolt is an auxiliary function for building up a RStorm topology. After initializing a Topology object the AddBolt function can be used to build the topology and specify the order of the Bolts. A Bolt receives as its first argument the Tuple emitted by the previous element in the Stream.

Usage

1
AddBolt(topology, bolt, .verbose = TRUE)

Arguments

topology

a Topology object to add the bolt to.

bolt

a Bolt to add to the topology. These are created using the Bolt() function.

.verbose

a logical indicator to state whether or not verbose output should be printed. Default TRUE.

Value

An object of type Topology which is a list containing the following elements:

spout

the data.frame passed as a spout

bolts

a list of bolts, see Bolt

finailze

the finalize function to be used for the stream

The specified Bolt has now been added to the list of bolts. See Topology for more info.

Warning

Functions which get added to a Topology using the AddBolt functionality should always use the ... argument. This argument is used to facilitate the processing of the stream. See example below for a minimal functional example of a correctly specified bolt.

Author(s)

Maurits Kaptein

See Also

See Also: Topology, Bolt, RStorm

Examples

1
2
3
4
5
# Create a topology and add a bolt to it.
bolt1 <- function(x, ...){print(x)}
topology <- Topology(data.frame(x=c(1:10)))
topology <- AddBolt(topology, Bolt(bolt1, listen=0))
topology

RStorm documentation built on May 2, 2019, 9:14 a.m.

Related to AddBolt in RStorm...