Module riak_pipe_w_xform

Alter an input, and send the alteration as output.

Behaviours: riak_pipe_vnode_worker.

Description

Alter an input, and send the alteration as output. For each input, the fitting evaluates a function (passed as the fitting argument). That function should accept three parameters:
Input :: term()
Whatever the upstream fitting has sent.
Partition :: riak_pipe_vnode:partition()
The partition of the vnode on which this worker is running. Necessary for logging and sending output.
FittingDetails :: #fitting_details{}
The details for the fitting. Also necessary for logging and sending output.
The function should use Partition and FittingDetails along with riak_pipe_vnode_worker:send_output/3 to send whatever outputs it likes (this allows the fitting to be used as "filter" as well as "map").

Data Types

state()

abstract datatype: state()

Function Index

done/1Unused.
init/2Init just stashes the Partition and FittingDetails for later.
process/3Process evaluates the fitting's argument function.
validate_arg/1Check that the argument is a valid function of arity 3.

Function Details

done/1

done(State::state()) -> ok

Unused.

init/2

init(Partition::riak_pipe_vnode:partition(), FittingDetails::riak_pipe_fitting:details()) -> {ok, state()}

Init just stashes the Partition and FittingDetails for later.

process/3

process(Input::term(), Last::boolean(), State::state()) -> {ok, state()}

Process evaluates the fitting's argument function.

validate_arg/1

validate_arg(Fun::term()) -> ok | {error, iolist()}

Check that the argument is a valid function of arity 3. See riak_pipe_v_validate_function/3.


Generated by EDoc, Jan 11 2013, 18:45:59.