{"action":"created","comment":{"url":"https://api.github.com/repos/istio/mixer/pulls/comments/107666928","pull_request_review_id":28650523,"id":107666928,"diff_hunk":"@@ -0,0 +1,85 @@\n+// Copyright 2017 Google Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain 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, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package redisquota\n+\n+import (\n+\t\"github.com/golang/glog\"\n+\t\"github.com/mediocregopher/radix.v2/pool\"\n+\t\"github.com/mediocregopher/radix.v2/redis\"\n+)\n+\n+// ConnPoolImpl stores the info for redis connection pool.\n+type ConnPoolImpl struct {\n+\t// TODO: add number of connections here\n+\tpool *pool.Pool\n+}\n+\n+type connectionImpl struct {\n+\tclient  *redis.Client\n+\tpending uint\n+}\n+\n+type responseImpl struct {\n+\tresponse *redis.Resp\n+}\n+\n+// Get is to get a connection from the connection pool.\n+func (cp *ConnPoolImpl) Get() (Connection, error) {\n+\tclient, err := cp.pool.Get()\n+\n+\treturn &connectionImpl{client, 0}, err\n+}\n+\n+// Put is to put a connection c back to the pool.\n+func (cp *ConnPoolImpl) Put(c Connection) {\n+\timpl := c.(*connectionImpl)\n+\n+\tif impl.pending == 0 {\n+\t\tcp.pool.Put(impl.client)\n+\t} else {\n+\t\t// radix does not appear to track if we attempt to put a connection back with pipelined","path":"adapter/redisquota/driver_impl.go","position":52,"original_position":52,"commit_id":"e74cc88d1922a352d7b196b6a78d81cdfeb16faa","original_commit_id":"e74cc88d1922a352d7b196b6a78d81cdfeb16faa","user":{"login":"geeknoid","id":22780957,"avatar_url":"https://avatars0.githubusercontent.com/u/22780957?v=3","gravatar_id":"","url":"https://api.github.com/users/geeknoid","html_url":"https://github.com/geeknoid","followers_url":"https://api.github.com/users/geeknoid/followers","following_url":"https://api.github.com/users/geeknoid/following{/other_user}","gists_url":"https://api.github.com/users/geeknoid/gists{/gist_id}","starred_url":"https://api.github.com/users/geeknoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeknoid/subscriptions","organizations_url":"https://api.github.com/users/geeknoid/orgs","repos_url":"https://api.github.com/users/geeknoid/repos","events_url":"https://api.github.com/users/geeknoid/events{/privacy}","received_events_url":"https://api.github.com/users/geeknoid/received_events","type":"User","site_admin":false},"body":"radix -> redis","created_at":"2017-03-23T13:29:11Z","updated_at":"2017-03-23T13:57:29Z","html_url":"https://github.com/istio/mixer/pull/435#discussion_r107666928","pull_request_url":"https://api.github.com/repos/istio/mixer/pulls/435","_links":{"self":{"href":"https://api.github.com/repos/istio/mixer/pulls/comments/107666928"},"html":{"href":"https://github.com/istio/mixer/pull/435#discussion_r107666928"},"pull_request":{"href":"https://api.github.com/repos/istio/mixer/pulls/435"}}},"pull_request":{"url":"https://api.github.com/repos/istio/mixer/pulls/435","id":112074575,"html_url":"https://github.com/istio/mixer/pull/435","diff_url":"https://github.com/istio/mixer/pull/435.diff","patch_url":"https://github.com/istio/mixer/pull/435.patch","issue_url":"https://api.github.com/repos/istio/mixer/issues/435","number":435,"state":"open","locked":false,"title":"Add redis quota adapter.","user":{"login":"chowchow316","id":5264853,"avatar_url":"https://avatars3.githubusercontent.com/u/5264853?v=3","gravatar_id":"","url":"https://api.github.com/users/chowchow316","html_url":"https://github.com/chowchow316","followers_url":"https://api.github.com/users/chowchow316/followers","following_url":"https://api.github.com/users/chowchow316/following{/other_user}","gists_url":"https://api.github.com/users/chowchow316/gists{/gist_id}","starred_url":"https://api.github.com/users/chowchow316/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chowchow316/subscriptions","organizations_url":"https://api.github.com/users/chowchow316/orgs","repos_url":"https://api.github.com/users/chowchow316/repos","events_url":"https://api.github.com/users/chowchow316/events{/privacy}","received_events_url":"https://api.github.com/users/chowchow316/received_events","type":"User","site_admin":false},"body":"This is the first PR for adding redis quota adapter into mixer, including basic logic how mixer talks to redis. \r\nWill add unit test and register in inventory later.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/istio/mixer/435)\n<!-- Reviewable:end -->\n","created_at":"2017-03-22T18:03:10Z","updated_at":"2017-03-23T13:57:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7329cb40f76e422f43f493665851a90f60d3ea04","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/istio/mixer/pulls/435/commits","review_comments_url":"https://api.github.com/repos/istio/mixer/pulls/435/comments","review_comment_url":"https://api.github.com/repos/istio/mixer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/mixer/issues/435/comments","statuses_url":"https://api.github.com/repos/istio/mixer/statuses/e74cc88d1922a352d7b196b6a78d81cdfeb16faa","head":{"label":"chowchow316:add-redis-quota","ref":"add-redis-quota","sha":"e74cc88d1922a352d7b196b6a78d81cdfeb16faa","user":{"login":"chowchow316","id":5264853,"avatar_url":"https://avatars3.githubusercontent.com/u/5264853?v=3","gravatar_id":"","url":"https://api.github.com/users/chowchow316","html_url":"https://github.com/chowchow316","followers_url":"https://api.github.com/users/chowchow316/followers","following_url":"https://api.github.com/users/chowchow316/following{/other_user}","gists_url":"https://api.github.com/users/chowchow316/gists{/gist_id}","starred_url":"https://api.github.com/users/chowchow316/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chowchow316/subscriptions","organizations_url":"https://api.github.com/users/chowchow316/orgs","repos_url":"https://api.github.com/users/chowchow316/repos","events_url":"https://api.github.com/users/chowchow316/events{/privacy}","received_events_url":"https://api.github.com/users/chowchow316/received_events","type":"User","site_admin":false},"repo":{"id":85859141,"name":"mixer","full_name":"chowchow316/mixer","owner":{"login":"chowchow316","id":5264853,"avatar_url":"https://avatars3.githubusercontent.com/u/5264853?v=3","gravatar_id":"","url":"https://api.github.com/users/chowchow316","html_url":"https://github.com/chowchow316","followers_url":"https://api.github.com/users/chowchow316/followers","following_url":"https://api.github.com/users/chowchow316/following{/other_user}","gists_url":"https://api.github.com/users/chowchow316/gists{/gist_id}","starred_url":"https://api.github.com/users/chowchow316/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chowchow316/subscriptions","organizations_url":"https://api.github.com/users/chowchow316/orgs","repos_url":"https://api.github.com/users/chowchow316/repos","events_url":"https://api.github.com/users/chowchow316/events{/privacy}","received_events_url":"https://api.github.com/users/chowchow316/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chowchow316/mixer","description":"The Istio mixer and its adapters","fork":true,"url":"https://api.github.com/repos/chowchow316/mixer","forks_url":"https://api.github.com/repos/chowchow316/mixer/forks","keys_url":"https://api.github.com/repos/chowchow316/mixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chowchow316/mixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chowchow316/mixer/teams","hooks_url":"https://api.github.com/repos/chowchow316/mixer/hooks","issue_events_url":"https://api.github.com/repos/chowchow316/mixer/issues/events{/number}","events_url":"https://api.github.com/repos/chowchow316/mixer/events","assignees_url":"https://api.github.com/repos/chowchow316/mixer/assignees{/user}","branches_url":"https://api.github.com/repos/chowchow316/mixer/branches{/branch}","tags_url":"https://api.github.com/repos/chowchow316/mixer/tags","blobs_url":"https://api.github.com/repos/chowchow316/mixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chowchow316/mixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chowchow316/mixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/chowchow316/mixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chowchow316/mixer/statuses/{sha}","languages_url":"https://api.github.com/repos/chowchow316/mixer/languages","stargazers_url":"https://api.github.com/repos/chowchow316/mixer/stargazers","contributors_url":"https://api.github.com/repos/chowchow316/mixer/contributors","subscribers_url":"https://api.github.com/repos/chowchow316/mixer/subscribers","subscription_url":"https://api.github.com/repos/chowchow316/mixer/subscription","commits_url":"https://api.github.com/repos/chowchow316/mixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/chowchow316/mixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/chowchow316/mixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/chowchow316/mixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/chowchow316/mixer/contents/{+path}","compare_url":"https://api.github.com/repos/chowchow316/mixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chowchow316/mixer/merges","archive_url":"https://api.github.com/repos/chowchow316/mixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chowchow316/mixer/downloads","issues_url":"https://api.github.com/repos/chowchow316/mixer/issues{/number}","pulls_url":"https://api.github.com/repos/chowchow316/mixer/pulls{/number}","milestones_url":"https://api.github.com/repos/chowchow316/mixer/milestones{/number}","notifications_url":"https://api.github.com/repos/chowchow316/mixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chowchow316/mixer/labels{/name}","releases_url":"https://api.github.com/repos/chowchow316/mixer/releases{/id}","deployments_url":"https://api.github.com/repos/chowchow316/mixer/deployments","created_at":"2017-03-22T17:51:04Z","updated_at":"2017-03-22T17:51:06Z","pushed_at":"2017-03-23T07:55:51Z","git_url":"git://github.com/chowchow316/mixer.git","ssh_url":"git@github.com:chowchow316/mixer.git","clone_url":"https://github.com/chowchow316/mixer.git","svn_url":"https://github.com/chowchow316/mixer","homepage":"","size":12966,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"master"}},"base":{"label":"istio:master","ref":"master","sha":"89ca190aee6e738d5dae9b32d1722195ef6522cb","user":{"login":"istio","id":23534644,"avatar_url":"https://avatars2.githubusercontent.com/u/23534644?v=3","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":74177509,"name":"mixer","full_name":"istio/mixer","owner":{"login":"istio","id":23534644,"avatar_url":"https://avatars2.githubusercontent.com/u/23534644?v=3","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istio/mixer","description":"The Istio mixer and its adapters","fork":false,"url":"https://api.github.com/repos/istio/mixer","forks_url":"https://api.github.com/repos/istio/mixer/forks","keys_url":"https://api.github.com/repos/istio/mixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/mixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/mixer/teams","hooks_url":"https://api.github.com/repos/istio/mixer/hooks","issue_events_url":"https://api.github.com/repos/istio/mixer/issues/events{/number}","events_url":"https://api.github.com/repos/istio/mixer/events","assignees_url":"https://api.github.com/repos/istio/mixer/assignees{/user}","branches_url":"https://api.github.com/repos/istio/mixer/branches{/branch}","tags_url":"https://api.github.com/repos/istio/mixer/tags","blobs_url":"https://api.github.com/repos/istio/mixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/mixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/mixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/mixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/mixer/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/mixer/languages","stargazers_url":"https://api.github.com/repos/istio/mixer/stargazers","contributors_url":"https://api.github.com/repos/istio/mixer/contributors","subscribers_url":"https://api.github.com/repos/istio/mixer/subscribers","subscription_url":"https://api.github.com/repos/istio/mixer/subscription","commits_url":"https://api.github.com/repos/istio/mixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/mixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/mixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/mixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/mixer/contents/{+path}","compare_url":"https://api.github.com/repos/istio/mixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/mixer/merges","archive_url":"https://api.github.com/repos/istio/mixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/mixer/downloads","issues_url":"https://api.github.com/repos/istio/mixer/issues{/number}","pulls_url":"https://api.github.com/repos/istio/mixer/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/mixer/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/mixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/mixer/labels{/name}","releases_url":"https://api.github.com/repos/istio/mixer/releases{/id}","deployments_url":"https://api.github.com/repos/istio/mixer/deployments","created_at":"2016-11-19T00:40:17Z","updated_at":"2017-03-21T05:45:28Z","pushed_at":"2017-03-23T07:55:57Z","git_url":"git://github.com/istio/mixer.git","ssh_url":"git@github.com:istio/mixer.git","clone_url":"https://github.com/istio/mixer.git","svn_url":"https://github.com/istio/mixer","homepage":"","size":13598,"stargazers_count":15,"watchers_count":15,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":62,"forks":22,"open_issues":62,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/mixer/pulls/435"},"html":{"href":"https://github.com/istio/mixer/pull/435"},"issue":{"href":"https://api.github.com/repos/istio/mixer/issues/435"},"comments":{"href":"https://api.github.com/repos/istio/mixer/issues/435/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/mixer/pulls/435/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/mixer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/mixer/pulls/435/commits"},"statuses":{"href":"https://api.github.com/repos/istio/mixer/statuses/e74cc88d1922a352d7b196b6a78d81cdfeb16faa"}}}}
{"actor":{"display_login":"geeknoid"}}