Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB codec for get_coverage [2/3] #1397

Merged
merged 6 commits into from
Apr 19, 2016

Conversation

hmmr
Copy link
Contributor

@hmmr hmmr commented Apr 17, 2016

This is Part 2/3 of #1382 broken up and reassembled into new commits.

Requires (includes) #1396 and basho/riak_pb#190.

This PR removes the code assembling #tscoverageresp from riak_kv, to be added in the linked riak_pb PR. The callbacks in the common module serving both PB and TTB messages need to only ever return plain Erlang terms. For PB messages, appropriate codecs will be used (from riak_pb_ts_codec), while TTB messages are transmitted (as if) without any conversion.

Andrei Zavada added 2 commits April 19, 2016 13:55
relies on the code moved from riak_kv_ts_svc over to riak_pb_ts_codec.
@hmmr hmmr force-pushed the reorg-az-pb_codec_for_get_coverage branch from 2bb5e6a to 3cb7eb1 Compare April 19, 2016 11:23
Bucket = riak_kv_ts_util:table_to_bucket(Table),
Client = {riak_client, [node(), undefined]},
convert_cover_list(sql_to_cover(Client, Queries, Bucket, []), State)
?E_BAD_QUERY, flat_format("Failed to parse query: ~p", [Reason])),
Copy link

@andytill andytill Apr 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ~p means this message will always look really bad, if it is a string it will speech marks it will have all the bracks. If I force a parsing error in riak_test I get this.

================ ts_cluster_coverage failure stack trace =====================
{{badmatch,{error,{1018,
                   <<"Failed to parse query: {<<\"selectah\">>,riak_ql_parser,\n [\"syntax error before: \",\"identifier"]}">>}}},
 [{ts_cluster_coverage,test_quanta_range,5,
                       [{file,"tests/ts_cluster_coverage.erl"},{line,54}]},
  {ts_cluster_coverage,confirm,0,
                       [{file,"tests/ts_cluster_coverage.erl"},{line,45}]},
  {riak_test_runner,return_to_exit,3,
                    [{file,"src/riak_test_runner.erl"},{line,196}]}]}
==============================================================================

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A proper error retval matching is in order. I did this for the main tsqueryreq case; time to fix it here, too.

@andytill
Copy link

+1 2ad8f53

borshop added a commit that referenced this pull request Apr 19, 2016
PB codec for get_coverage [2/3]

Reviewed-by: andytill
@andytill
Copy link

@borshop merge

@borshop borshop merged commit 2ad8f53 into riak_ts-develop Apr 19, 2016
@hmmr hmmr deleted the reorg-az-pb_codec_for_get_coverage branch April 19, 2016 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants