-
Notifications
You must be signed in to change notification settings - Fork 32
/
riak_pipe_vnode_worker.erl
66 lines (54 loc) · 1.43 KB
/
riak_pipe_vnode_worker.erl
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
%%% -*- mode: erlang -*-
%%% vim: set filetype=erlang tabstop=2 foldmarker=%%%',%%%. foldmethod=marker:
%%%' HEADER
%%% @copyright {{copyright_year}} {{author_name}} <{{author_email}}>
%%% @license {{license}}
%%% @doc
%%% {{description}}
%%% @end
-module({{name}}_vnode_worker).
-behavior(riak_pipe_vnode_worker).
-export([
init/2,
process/3,
done/1
]).
-include("riak_pipe.hrl").
-include("riak_pipe_log.hrl").
-record(state,
{ partition :: riak_pipe_vnode:partition()
, fitting_details :: riak_pipe_fitting:details()
}
).
-opaque state() :: #state{}.
% TODO: Add macros or records here if pertinent
%%%.
%%%' PUBLIC API
%% @doc Initialization stores the partition and fitting details
%% in the module's state record so it can send outputs from
%% {@link process/3}.
-spec init(Partition, FittingDetails) -> {ok, state()}
when
Partition :: riak_pipe_vnode:partition(),
FittingDetails :: riak_pipe_vnode:details().
init(_Partition, _FittingDetails) ->
% TODO: Implement
not_implemented.
%% @doc
-spec process(Input, Last, State) -> {ok, NewState}
when
Input :: any(),
Last :: any(),
State :: state(),
NewState :: state().
process(_Input, _Last, _State) ->
% TODO: Implement
not_implemented.
-spec done(State :: state()) -> ok.
done(_State) ->
% TODO: Implement
not_implemented.
%%%.
%%%' PRIVATE FUNCTIONS
% TODO: Add private helper functions here.
%%%.