Learn R Programming

RStorm (version 1.0)

GetHashList: Function to retrieve a list of locally stored object resulting from the stream.

Description

Function retrieves from an RStorm result object (after running a stream) all the items stored in during the stream (using SetHash) as a list.

Usage

GetHashList(object = NULL)

Arguments

object

a RStorm result object

Value

a list containing all objects stored using SetHash during a stream.

See Also

See Also: SetHash, GetHash, GetHashNames

Examples

Run this code
# NOT RUN {
# Create a topology
topology <- Topology(data.frame(x=rnorm(100,0,1)))

# Create two bolts and add them to the topology
computeSum <- function(x, ...){
	sum <- GetHash("sum")
	if(is.data.frame(sum)){
		x <- sum + (x[1])
	}
	SetHash("sum", x)
}
computeSumSquared <- function(x, ...){
	sum2 <- GetHash("sum2")
	if(is.data.frame(sum2)){
		x <- sum2 + (x[1]^2)
	}
	SetHash("sum2", x)
}
topology <- AddBolt(topology, Bolt(computeSum))
topology <- AddBolt(topology, Bolt(computeSumSquared))

# Run the stream
result <- RStorm(topology)

# Get the names of all the stored objects during the stream
names(GetHashList(result))


# }

Run the code above in your browser using DataLab