{"action":"opened","number":29,"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29","id":125996826,"html_url":"https://github.com/VoltDB/voltdb-client-go/pull/29","diff_url":"https://github.com/VoltDB/voltdb-client-go/pull/29.diff","patch_url":"https://github.com/VoltDB/voltdb-client-go/pull/29.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/29","number":29,"state":"open","locked":false,"title":"[WIP] Add new  Encoder Implemenatation","user":{"login":"gernest","id":6039952,"avatar_url":"https://avatars1.githubusercontent.com/u/6039952?v=3","gravatar_id":"","url":"https://api.github.com/users/gernest","html_url":"https://github.com/gernest","followers_url":"https://api.github.com/users/gernest/followers","following_url":"https://api.github.com/users/gernest/following{/other_user}","gists_url":"https://api.github.com/users/gernest/gists{/gist_id}","starred_url":"https://api.github.com/users/gernest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gernest/subscriptions","organizations_url":"https://api.github.com/users/gernest/orgs","repos_url":"https://api.github.com/users/gernest/repos","events_url":"https://api.github.com/users/gernest/events{/privacy}","received_events_url":"https://api.github.com/users/gernest/received_events","type":"User","site_admin":false},"body":"__APOLOGIES__: Please DO NOT MERGE This needs a JIRA ticket to track, unfortunate that ticket doesn't exist yet so I have decided to keep hacking on this while waiting. \r\n\r\nNOTES:\r\n\r\nThe current encoding/decoding implementation is not visible, making reasoning about the wire protocol a bit hard.\r\n\r\nI will use this function taken from the client as an example\r\n\r\n```go\r\nfunc writeShort(w io.Writer, d int16) error {\r\n    ...\r\n}\r\n```\r\n\r\nFirst, the name `writeShort` doesnt say much about what this is up to. It happens `Short` refers to `int16` \r\n, the function signature too, will not help ease navigation through the code base.\r\n\r\nI propose changing the API to something like this\r\n\r\n```go\r\n// Int16 encodes int16 value to voltdb wire protocol Short. For a successful\r\n// encoding the number of bytes written is 2\r\nfunc (e *Encoder) Int16(v int16) (int, error) {\r\n      ...\r\n}\r\n```\r\n\r\nHere, we will have very rich API with relevant infromation like\r\n- How many bytes a `int16`/`Short` occupies when encoded\r\n- We can optimize how we store the encoded values either in `[]byte` or any optimal ways without relying on an external `io.Writer`\r\n\r\nCAVEATS\r\n\r\nThe new encoder does not/ will not play well with the current client implementation. Since I will end up rewriting most part of the client this should not be a big issue, I will not refactor the existing client to use the new encoder to avoid wasting of time.","created_at":"2017-06-16T09:44:24Z","updated_at":"2017-06-16T09:44:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/29/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/statuses/b4bb053139962af0aecb1394733c1ad7f06d0e4b","head":{"label":"gernest:encoder","ref":"encoder","sha":"b4bb053139962af0aecb1394733c1ad7f06d0e4b","user":{"login":"gernest","id":6039952,"avatar_url":"https://avatars1.githubusercontent.com/u/6039952?v=3","gravatar_id":"","url":"https://api.github.com/users/gernest","html_url":"https://github.com/gernest","followers_url":"https://api.github.com/users/gernest/followers","following_url":"https://api.github.com/users/gernest/following{/other_user}","gists_url":"https://api.github.com/users/gernest/gists{/gist_id}","starred_url":"https://api.github.com/users/gernest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gernest/subscriptions","organizations_url":"https://api.github.com/users/gernest/orgs","repos_url":"https://api.github.com/users/gernest/repos","events_url":"https://api.github.com/users/gernest/events{/privacy}","received_events_url":"https://api.github.com/users/gernest/received_events","type":"User","site_admin":false},"repo":{"id":94193231,"name":"voltdb-client-go","full_name":"gernest/voltdb-client-go","owner":{"login":"gernest","id":6039952,"avatar_url":"https://avatars1.githubusercontent.com/u/6039952?v=3","gravatar_id":"","url":"https://api.github.com/users/gernest","html_url":"https://github.com/gernest","followers_url":"https://api.github.com/users/gernest/followers","following_url":"https://api.github.com/users/gernest/following{/other_user}","gists_url":"https://api.github.com/users/gernest/gists{/gist_id}","starred_url":"https://api.github.com/users/gernest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gernest/subscriptions","organizations_url":"https://api.github.com/users/gernest/orgs","repos_url":"https://api.github.com/users/gernest/repos","events_url":"https://api.github.com/users/gernest/events{/privacy}","received_events_url":"https://api.github.com/users/gernest/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gernest/voltdb-client-go","description":"VoltDB Golang Client Library","fork":true,"url":"https://api.github.com/repos/gernest/voltdb-client-go","forks_url":"https://api.github.com/repos/gernest/voltdb-client-go/forks","keys_url":"https://api.github.com/repos/gernest/voltdb-client-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gernest/voltdb-client-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gernest/voltdb-client-go/teams","hooks_url":"https://api.github.com/repos/gernest/voltdb-client-go/hooks","issue_events_url":"https://api.github.com/repos/gernest/voltdb-client-go/issues/events{/number}","events_url":"https://api.github.com/repos/gernest/voltdb-client-go/events","assignees_url":"https://api.github.com/repos/gernest/voltdb-client-go/assignees{/user}","branches_url":"https://api.github.com/repos/gernest/voltdb-client-go/branches{/branch}","tags_url":"https://api.github.com/repos/gernest/voltdb-client-go/tags","blobs_url":"https://api.github.com/repos/gernest/voltdb-client-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gernest/voltdb-client-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gernest/voltdb-client-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/gernest/voltdb-client-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gernest/voltdb-client-go/statuses/{sha}","languages_url":"https://api.github.com/repos/gernest/voltdb-client-go/languages","stargazers_url":"https://api.github.com/repos/gernest/voltdb-client-go/stargazers","contributors_url":"https://api.github.com/repos/gernest/voltdb-client-go/contributors","subscribers_url":"https://api.github.com/repos/gernest/voltdb-client-go/subscribers","subscription_url":"https://api.github.com/repos/gernest/voltdb-client-go/subscription","commits_url":"https://api.github.com/repos/gernest/voltdb-client-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/gernest/voltdb-client-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/gernest/voltdb-client-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/gernest/voltdb-client-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/gernest/voltdb-client-go/contents/{+path}","compare_url":"https://api.github.com/repos/gernest/voltdb-client-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gernest/voltdb-client-go/merges","archive_url":"https://api.github.com/repos/gernest/voltdb-client-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gernest/voltdb-client-go/downloads","issues_url":"https://api.github.com/repos/gernest/voltdb-client-go/issues{/number}","pulls_url":"https://api.github.com/repos/gernest/voltdb-client-go/pulls{/number}","milestones_url":"https://api.github.com/repos/gernest/voltdb-client-go/milestones{/number}","notifications_url":"https://api.github.com/repos/gernest/voltdb-client-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gernest/voltdb-client-go/labels{/name}","releases_url":"https://api.github.com/repos/gernest/voltdb-client-go/releases{/id}","deployments_url":"https://api.github.com/repos/gernest/voltdb-client-go/deployments","created_at":"2017-06-13T09:07:06Z","updated_at":"2017-06-13T09:07:08Z","pushed_at":"2017-06-16T09:17:22Z","git_url":"git://github.com/gernest/voltdb-client-go.git","ssh_url":"git@github.com:gernest/voltdb-client-go.git","clone_url":"https://github.com/gernest/voltdb-client-go.git","svn_url":"https://github.com/gernest/voltdb-client-go","homepage":null,"size":334,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"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":"VoltDB:master","ref":"master","sha":"5f38694369076d56b3730402e0be21ef0fbd3546","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":58485921,"name":"voltdb-client-go","full_name":"VoltDB/voltdb-client-go","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb-client-go","description":"VoltDB Golang Client Library","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb-client-go","forks_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb-client-go/deployments","created_at":"2016-05-10T18:53:17Z","updated_at":"2017-06-13T14:44:38Z","pushed_at":"2017-06-16T09:18:50Z","git_url":"git://github.com/VoltDB/voltdb-client-go.git","ssh_url":"git@github.com:VoltDB/voltdb-client-go.git","clone_url":"https://github.com/VoltDB/voltdb-client-go.git","svn_url":"https://github.com/VoltDB/voltdb-client-go","homepage":null,"size":333,"stargazers_count":16,"watchers_count":16,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":10,"forks":7,"open_issues":10,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29"},"html":{"href":"https://github.com/VoltDB/voltdb-client-go/pull/29"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/29"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb-client-go/statuses/b4bb053139962af0aecb1394733c1ad7f06d0e4b"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":121,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"gernest"}}