Skip to content

Commit

Permalink
decode get_coverage return value
Browse files Browse the repository at this point in the history
  • Loading branch information
hmmr committed Apr 17, 2016
1 parent 86a53e2 commit bff6899
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/riakc_ts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ query_common(Pid, Query, Interpolations, Cover, Options)


%% @doc Generate a parallel coverage plan for the specified query
-spec get_coverage(Pid::pid(),
Table::binary(),
QueryText::binary()) -> {ok, Entries::[term()]} | {error, term()} | {'EXIT', any()}.
get_coverage(Pid, Table, QueryText) ->
server_call(Pid,
#tscoveragereq{query = #tsinterpolation{base = iolist_to_binary(QueryText)},
replace_cover = undefined,
table = iolist_to_binary(Table)}).
-spec get_coverage(pid(), table_name(), QueryText::iolist()) ->
{ok, Entries::[term()]} | {error, term()}.
get_coverage(Pid, Table, Query) ->
Message =
#tscoveragereq{query = #tsinterpolation{base = iolist_to_binary(Query)},
replace_cover = undefined,
table = iolist_to_binary(Table)},
case server_call(Pid, Message) of
{ok, Entries} ->
{ok, riak_pb_ts_codec:decode_cover_list(Entries)};
{error, Reason} ->
{error, Reason}
end.


-spec put(pid(),
Expand Down

0 comments on commit bff6899

Please sign in to comment.