{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/14780","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14780/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14780/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14780/events","html_url":"https://github.com/elastic/elasticsearch/pull/14780","id":117184788,"number":14780,"title":"Variable-length long encoding","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Internal","name":":Internal","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/enhancement","name":"enhancement","color":"4a4ea8"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/review","name":"review","color":"0052cc"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v3.0.0","name":"v3.0.0","color":"dddddd"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-16T18:08:27Z","updated_at":"2015-11-16T22:59:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/14780","html_url":"https://github.com/elastic/elasticsearch/pull/14780","diff_url":"https://github.com/elastic/elasticsearch/pull/14780.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/14780.patch"},"body":"This commit adds a method of encoding longs using a variable-length\r\nrepresentation. This encoding is an implementation of the zig-zag\r\nencoding from protocol buffers. Numbers that have a small absolute value\r\nwill use a small number of bytes. This is achieved by zig-zagging\r\nthrough the space of longs in order of increasing absolute value `(0, -1,\r\n1, -2, 2, …, Long.MAX_VALUE, Long.MIN_VALUE) -> (0, 1, 2, 3, 4, …, -2,\r\n-1)`. The resulting values are then encoded as if they represent unsigned\r\nnumbers.\r\n\r\nAdditionally, the existing methods `StreamOutput#writeVLong` and\r\n`StreamInput#readVLong` are renamed to reflect the fact that they do not\r\naccept nor produce negative longs."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/157201910","html_url":"https://github.com/elastic/elasticsearch/pull/14780#issuecomment-157201910","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/14780","id":157201910,"user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T22:59:16Z","updated_at":"2015-11-16T22:59:16Z","body":"> the vlong encoding already suggests it's designed for small positive values.\r\n\r\n@jpountz Yeah, the disagreement stems from me thinking that \"positive\" should be struck from that sentence fragment, and that `writeVInt` does support negative values.\r\n\r\nI'm okay changing the name back. It's never worth bickering endlessly over issues like this.\r\n\r\nI've reverted the name change in efcfd516093687f73713dae8e4b75a3559c00f0b. When I squash I'll change the initial commit message to remove the discussion of the method name change."}}