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

TS HTTP client API #1355

Closed
wants to merge 19 commits into from
Closed

TS HTTP client API #1355

wants to merge 19 commits into from

Conversation

hmmr
Copy link
Contributor

@hmmr hmmr commented Feb 27, 2016

RTS-258

Implement these HTTP API calls (intending eventually to comply with https://docs.google.com/document/d/19cxGPEo7rQdjsC3jUw_40eiICwAN_OzPuT_F-eLXTt8):

GET       /ts/v1/tables/Table/keys        single-key get
DELETE    /ts/v1/tables/Table/keys        single-key delete
POST      /ts/v1/tables/Table/keys        batch put
GET       /ts/v1/tables/Table/list_keys   streaming list_keys
GET       /ts/v1/coverage             coverage for a query *
GET/POST  /ts/v1/query                execute an SQL query (SELECT or DESCRIBE with GET,
                                      CREATE TABLE with POST)

(*) disabled for now.

The keys for get and delete are to be given on the URL, either as "/F1/V1/F2/V2/F3/V3", where key-constituent field-value pairs can be in arbitrary order, or as bare values: "/V1/V2/V3", with Vn value for the corresponding field Fn.

The data and query for put and query should be submitted in request body, as in the real-world use case with curl: https://gist.github.com/hmmr/94abdb4d648a44009e93 and in r_t module basho/riak_test#1008.

The required TS extensions to riak-erlang-http-client are in basho/riak-erlang-http-client#55. A tweak in riak-erlang-client for riakc_ts:get/3 return value is in basho/riak-erlang-client#261. (These are not dependencies of the present PR.)

Brett Hazen and others added 15 commits February 27, 2016 15:47
Enable the following requests:

GET    /ts/1/table/Table          single-key get
DELETE /ts/1/table/Table          single-key delete
PUT    /ts/1/table/Table          batch put
GET    /ts/1/table/Table/keys     list_keys
GET    /ts/1/coverage             coverage for a query
POST   /ts/1/query                execute SQL query

Additional parameters (keys, data, query) are to be supplied in
request body, as a JSON object.
Complementary to 9b62335 by atill

The call to claimant to determine a table's bucket type status is an
expensive operation.  It was introduced in a1c1e2e, with the purpose to
detect and report the error condition where a TS operation is attempted on
a non-activated bucket type, but found to cause serious performance
degradation. Andy's commit removed the expensive call; this commit captures
and reports the error condition in various places in
riak_kv_{wm,pb}_timeseries and riak_kv_ts_util.
andalso, check detailed per-table permissions when security is on.
because there were no changes for them to progress to 1.3, whereby
they lose the version and become riak_ts-develop.
…lete

The version with both key-in-json and key-in-url is forked into own branch
feature-az-http_ts_api_with_keys_in_json_in_body.

If a decision is taken to resurrect that branch, there is a complementary
branch, of the same name, in riak-erlang-http-client, which can produce
requests with key in json.
* don't support coverage API call in HTTP callbacks;
* unify permission strings, for shared use between wm and pb callbacks;
* straighten up function call chain in riak_kv_wm_timeseries, now that
  all api calls are mapped 1:1 onto HTTP methods;
* in particular, use wrq:path_info/2 to get table and keys, instead of
  clunky tokenization where it's no longer necessary;
* introduce security and validation checks for listkeys.
@hmmr hmmr force-pushed the feature-az-http_client branch from 1af30bf to 574edcc Compare March 1, 2016 11:41
Andrei Zavada added 2 commits March 1, 2016 18:00
@hmmr hmmr force-pushed the feature-az-http_client branch 2 times, most recently from fe3c070 to 1e5249d Compare March 2, 2016 15:29
@hmmr hmmr force-pushed the feature-az-http_client branch from 1e5249d to 4e20c20 Compare March 2, 2016 15:36
@hmmr
Copy link
Contributor Author

hmmr commented Apr 11, 2016

Development switched to #1382.

@hmmr hmmr closed this Apr 11, 2016
@martincox martincox deleted the feature-az-http_client branch June 14, 2019 09:15
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.

1 participant