Description Usage Arguments Value Author(s) See Also Examples
Function retrieves from an RStorm result object (after running a stream) all the items stored in during the stream (using SetHash
) as a list.
1 | GetHashList(object = NULL)
|
object |
a |
a list containing all objects stored using SetHash
during a stream.
Maurits Kaptein
See Also: SetHash
, GetHash
, GetHashNames
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.