com.rpl.rama.ops

current-microbatch-id

(current-microbatch-id)

Returns ID of current microbatch attempt. Can only be called within a microbatch topology. This can be used to achieve fault-tolerant exactly-once update semantics when updating external systems with Rama’s integration API.

current-task-id

(current-task-id)

Returns task ID where event is running.

expand

(expand *data :> & fields)

Emits every element of input list as a separate field. Useful for processing elements of fixed-size lists.

Example:

(ops/expand *data :> *a *b *c)

explode

(explode *sequence :> *element)

Emits once for each element of a sequence. For example:

(?<-
  (explode [1 2 3] :> *v)
  (println *v))
1
2
3
nil

explode-indexed

(explode-indexed *sequence :> *index *element)

Same as explode except also outputs the index of each element. For example:

(?<-
  (ops/explode-indexed [:a :b :c] :> *i *v)
  (println *i *v))
0 :a
1 :b
2 :c
nil

explode-map

(explode-map *map :> *key *value)

Like explode except emits each key/value pair as separate elements. For example:

(?<-
  (ops/explode-map {:a 1 :b 2 :c 3} :> *k *v)
  (println *k *v))
:a 1
:b 2
:c 3
nil

module-instance-info

(module-instance-info)

Returns ModuleInstanceInfo for module and worker of running event.

range>

(range> *start *end :> *value)

Like Clojure range, but emits once per element in the range.

Example:

(?<-
  (range> 10 13 :> *v)
  (println *v))
10
11
12
nil

sum

(sum nums)

Returns sum of values in provided sequence.

vget

(vget $$pstate :> *value)

Extracts contents of a PState as a value. Should only be called on PStates with a top-level Class schema.