{"action":"created","comment":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/comments/56642288","id":56642288,"diff_hunk":"@@ -0,0 +1,121 @@\n+%% -------------------------------------------------------------------\n+%%\n+%% riak_kv_wm_ts_util: utility functions for riak_kv_wm_timeseries* resources.\n+%%\n+%% Copyright (c) 2016 Basho Technologies, Inc.  All Rights Reserved.\n+%%\n+%% This file is provided to you under the Apache License,\n+%% Version 2.0 (the \"License\"); you may not use this file\n+%% except in compliance with the License.  You may obtain\n+%% a copy of the License at\n+%%\n+%%   http://www.apache.org/licenses/LICENSE-2.0\n+%%\n+%% Unless required by applicable law or agreed to in writing,\n+%% software distributed under the License is distributed on an\n+%% \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+%% KIND, either express or implied.  See the License for the\n+%% specific language governing permissions and limitations\n+%% under the License.\n+%%\n+%% -------------------------------------------------------------------\n+-module(riak_kv_wm_ts_util).\n+\n+\n+-export([table_from_request/1]).\n+-export([utf8_to_binary/1]).\n+-export([flat_format/2]).\n+-export([set_text_resp_header/2]).\n+-export([set_error_message/3]).\n+-export([set_json_response/2]).\n+\n+-export([authorize/3]).\n+\n+-export([table_module_exists/1]).\n+\n+-export([local_key/1]).\n+\n+-export([local_key_fields_and_types/1]).\n+\n+-include_lib(\"webmachine/include/webmachine.hrl\").\n+-include_lib(\"riak_ql/include/riak_ql_ddl.hrl\").\n+-include(\"riak_kv_wm_raw.hrl\").\n+-include(\"riak_kv_ts.hrl\").\n+\n+\n+%% @private\n+table_from_request(RD) ->\n+    utf8_to_binary(\n+      mochiweb_util:unquote(\n+        wrq:path_info(table, RD))).\n+\n+%% move to util module.\n+utf8_to_binary(S) ->\n+    unicode:characters_to_binary(S, utf8, utf8).\n+\n+flat_format(Format, Args) ->","path":"src/riak_kv_wm_ts_util.erl","position":56,"original_position":56,"commit_id":"cb706e94c1e2f2c774f10629b080f131dd7d245a","original_commit_id":"bc80ebb6a65d53c8d4fa977e9d835360adbfe711","user":{"login":"lehoff","id":193034,"avatar_url":"https://avatars.githubusercontent.com/u/193034?v=3","gravatar_id":"","url":"https://api.github.com/users/lehoff","html_url":"https://github.com/lehoff","followers_url":"https://api.github.com/users/lehoff/followers","following_url":"https://api.github.com/users/lehoff/following{/other_user}","gists_url":"https://api.github.com/users/lehoff/gists{/gist_id}","starred_url":"https://api.github.com/users/lehoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehoff/subscriptions","organizations_url":"https://api.github.com/users/lehoff/orgs","repos_url":"https://api.github.com/users/lehoff/repos","events_url":"https://api.github.com/users/lehoff/events{/privacy}","received_events_url":"https://api.github.com/users/lehoff/received_events","type":"User","site_admin":false},"body":"I don't think \"too simple and too generic\" is a reason to exclude a function from being exported.\r\n\r\nIt is ment for `riak_kv_wm_timeseries` modules. If others don't have the discipline to raise this to a higher level it is their problem.\r\n\r\n@jonmeredith - what is your take on the above?\r\n\r\nBut I will investigate if I can avoid exporting it as I don't think I use it that much.","created_at":"2016-03-18T11:18:48Z","updated_at":"2016-03-18T11:18:48Z","html_url":"https://github.com/basho/riak_kv/pull/1371#discussion_r56642288","pull_request_url":"https://api.github.com/repos/basho/riak_kv/pulls/1371","_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments/56642288"},"html":{"href":"https://github.com/basho/riak_kv/pull/1371#discussion_r56642288"},"pull_request":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1371"}}},"pull_request":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/1371","id":62739019,"html_url":"https://github.com/basho/riak_kv/pull/1371","diff_url":"https://github.com/basho/riak_kv/pull/1371.diff","patch_url":"https://github.com/basho/riak_kv/pull/1371.patch","issue_url":"https://api.github.com/repos/basho/riak_kv/issues/1371","number":1371,"state":"open","locked":false,"title":"Feature th http client for RTS-258","user":{"login":"lehoff","id":193034,"avatar_url":"https://avatars.githubusercontent.com/u/193034?v=3","gravatar_id":"","url":"https://api.github.com/users/lehoff","html_url":"https://github.com/lehoff","followers_url":"https://api.github.com/users/lehoff/followers","following_url":"https://api.github.com/users/lehoff/following{/other_user}","gists_url":"https://api.github.com/users/lehoff/gists{/gist_id}","starred_url":"https://api.github.com/users/lehoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehoff/subscriptions","organizations_url":"https://api.github.com/users/lehoff/orgs","repos_url":"https://api.github.com/users/lehoff/repos","events_url":"https://api.github.com/users/lehoff/events{/privacy}","received_events_url":"https://api.github.com/users/lehoff/received_events","type":"User","site_admin":false},"body":"Re-worked to use Webmachine better.\r\n\r\nOpen issues:\r\n\r\n- The query API only accepts POST and uses a ?query=\"...\" query string in the URL to pass in the query. This is to make it consistent across HTTP methods if we want to match the side effects of the query with the HTTP method.\r\n- The output from list_keys is some hrefs inside a `<html>` block. Perhaps we should change the design and provide something more useful. It is not of much use when doing a curl or http (httpie.org) request on the command line.\r\n- Dialzyer is not fully happy about the listkeys module, but it smells like a Dialyzer bug - see comment in that file.\r\n- The commits have not been squashed - open to doing that before doing the final PR.\r\n","created_at":"2016-03-14T12:19:24Z","updated_at":"2016-03-18T11:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a22ec2b9c6f4a2070c3483a05ae59cd98580808","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/basho/riak_kv/pulls/1371/commits","review_comments_url":"https://api.github.com/repos/basho/riak_kv/pulls/1371/comments","review_comment_url":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/riak_kv/issues/1371/comments","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/cb706e94c1e2f2c774f10629b080f131dd7d245a","head":{"label":"lehoff:feature-th-http_client","ref":"feature-th-http_client","sha":"cb706e94c1e2f2c774f10629b080f131dd7d245a","user":{"login":"lehoff","id":193034,"avatar_url":"https://avatars.githubusercontent.com/u/193034?v=3","gravatar_id":"","url":"https://api.github.com/users/lehoff","html_url":"https://github.com/lehoff","followers_url":"https://api.github.com/users/lehoff/followers","following_url":"https://api.github.com/users/lehoff/following{/other_user}","gists_url":"https://api.github.com/users/lehoff/gists{/gist_id}","starred_url":"https://api.github.com/users/lehoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehoff/subscriptions","organizations_url":"https://api.github.com/users/lehoff/orgs","repos_url":"https://api.github.com/users/lehoff/repos","events_url":"https://api.github.com/users/lehoff/events{/privacy}","received_events_url":"https://api.github.com/users/lehoff/received_events","type":"User","site_admin":false},"repo":{"id":51916045,"name":"riak_kv","full_name":"lehoff/riak_kv","owner":{"login":"lehoff","id":193034,"avatar_url":"https://avatars.githubusercontent.com/u/193034?v=3","gravatar_id":"","url":"https://api.github.com/users/lehoff","html_url":"https://github.com/lehoff","followers_url":"https://api.github.com/users/lehoff/followers","following_url":"https://api.github.com/users/lehoff/following{/other_user}","gists_url":"https://api.github.com/users/lehoff/gists{/gist_id}","starred_url":"https://api.github.com/users/lehoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehoff/subscriptions","organizations_url":"https://api.github.com/users/lehoff/orgs","repos_url":"https://api.github.com/users/lehoff/repos","events_url":"https://api.github.com/users/lehoff/events{/privacy}","received_events_url":"https://api.github.com/users/lehoff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lehoff/riak_kv","description":"Riak Key/Value Store","fork":true,"url":"https://api.github.com/repos/lehoff/riak_kv","forks_url":"https://api.github.com/repos/lehoff/riak_kv/forks","keys_url":"https://api.github.com/repos/lehoff/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lehoff/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lehoff/riak_kv/teams","hooks_url":"https://api.github.com/repos/lehoff/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/lehoff/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/lehoff/riak_kv/events","assignees_url":"https://api.github.com/repos/lehoff/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/lehoff/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/lehoff/riak_kv/tags","blobs_url":"https://api.github.com/repos/lehoff/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lehoff/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lehoff/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/lehoff/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lehoff/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/lehoff/riak_kv/languages","stargazers_url":"https://api.github.com/repos/lehoff/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/lehoff/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/lehoff/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/lehoff/riak_kv/subscription","commits_url":"https://api.github.com/repos/lehoff/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/lehoff/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/lehoff/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/lehoff/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/lehoff/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/lehoff/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lehoff/riak_kv/merges","archive_url":"https://api.github.com/repos/lehoff/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lehoff/riak_kv/downloads","issues_url":"https://api.github.com/repos/lehoff/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/lehoff/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/lehoff/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/lehoff/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lehoff/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/lehoff/riak_kv/releases{/id}","deployments_url":"https://api.github.com/repos/lehoff/riak_kv/deployments","created_at":"2016-02-17T10:56:54Z","updated_at":"2016-02-17T10:56:56Z","pushed_at":"2016-03-18T10:10:55Z","git_url":"git://github.com/lehoff/riak_kv.git","ssh_url":"git@github.com:lehoff/riak_kv.git","clone_url":"https://github.com/lehoff/riak_kv.git","svn_url":"https://github.com/lehoff/riak_kv","homepage":"","size":11998,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"basho:feature-az-http_client","ref":"feature-az-http_client","sha":"4e20c2079ecd755463040e9ed8b6f1ae4105efeb","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":791522,"name":"riak_kv","full_name":"basho/riak_kv","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_kv","description":"Riak Key/Value Store","fork":false,"url":"https://api.github.com/repos/basho/riak_kv","forks_url":"https://api.github.com/repos/basho/riak_kv/forks","keys_url":"https://api.github.com/repos/basho/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_kv/teams","hooks_url":"https://api.github.com/repos/basho/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_kv/events","assignees_url":"https://api.github.com/repos/basho/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_kv/tags","blobs_url":"https://api.github.com/repos/basho/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_kv/languages","stargazers_url":"https://api.github.com/repos/basho/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_kv/subscription","commits_url":"https://api.github.com/repos/basho/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_kv/merges","archive_url":"https://api.github.com/repos/basho/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_kv/downloads","issues_url":"https://api.github.com/repos/basho/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_kv/releases{/id}","deployments_url":"https://api.github.com/repos/basho/riak_kv/deployments","created_at":"2010-07-22T17:27:35Z","updated_at":"2016-03-11T16:48:00Z","pushed_at":"2016-03-18T10:10:56Z","git_url":"git://github.com/basho/riak_kv.git","ssh_url":"git@github.com:basho/riak_kv.git","clone_url":"https://github.com/basho/riak_kv.git","svn_url":"https://github.com/basho/riak_kv","homepage":"","size":27768,"stargazers_count":295,"watchers_count":295,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":173,"forks":129,"open_issues":173,"watchers":295,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1371"},"html":{"href":"https://github.com/basho/riak_kv/pull/1371"},"issue":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1371"},"comments":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1371/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1371/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1371/commits"},"statuses":{"href":"https://api.github.com/repos/basho/riak_kv/statuses/cb706e94c1e2f2c774f10629b080f131dd7d245a"}}}}