Learn R Programming

RStorm (version 1.0)

AddFinalize: Function to add a finalize function to a Topology

Description

AddFinalize is an auxiliary function for building up a RStorm topology. After initializing a Topology object the AddFinalize function can be used to add a final function, which receives as its parameter a list of all hashMaps stored during the stream. After running the stream GetHashList can be used to receive an object that is the same as the object received by the finalize function.

Arguments

topology

a Topology object to add the bolt to.

bolt

a Bolt to add to as the finalize function.

.verbose

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

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 finalize function. See Topology for more info.

See Also

See Also: Topology, Bolt, RStorm

Examples

Run this code
# NOT RUN {
	bolt1 <- function(x, ...){print(x)}
	topology <- Topology(data.frame(x=c(1:10)))
	topology <- AddFinalize(topology, Bolt(bolt1))
	topology
# }

Run the code above in your browser using DataLab