GetHashList: Function to retrieve a list of locally stored object...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hashmap.R

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

1
GetHashList(object = NULL)

Arguments

object

a RStorm result object

Value

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

Author(s)

Maurits Kaptein

See Also

See Also: SetHash, GetHash, GetHashNames

Examples

 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))

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

Related to GetHashList in RStorm...