{"action":"created","comment":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/41135309","id":41135309,"diff_hunk":"@@ -0,0 +1,73 @@\n+package tsm1_test\n+\n+import (\n+\t\"testing\"\n+\n+\t\"github.com/influxdb/influxdb/tsdb/engine/tsm1\"\n+)\n+\n+func Test_BoolEncoder_NoValues(t *testing.T) {\n+\tenc := tsm1.NewBoolEncoder()\n+\tb, err := enc.Bytes()\n+\tif err != nil {\n+\t\tt.Fatalf(\"unexpected error: %v\", err)\n+\t}\n+\n+\tdec := tsm1.NewBoolDecoder(b)\n+\tif dec.Next() {\n+\t\tt.Fatalf(\"unexpected next value: got true, exp false\")\n+\t}\n+}\n+\n+func Test_BoolEncoder_Single(t *testing.T) {\n+\tenc := tsm1.NewBoolEncoder()\n+\tv1 := true\n+\tenc.Write(v1)\n+\tb, err := enc.Bytes()\n+\tif err != nil {\n+\t\tt.Fatalf(\"unexpected error: %v\", err)\n+\t}\n+\n+\tdec := tsm1.NewBoolDecoder(b)\n+\tif !dec.Next() {\n+\t\tt.Fatalf(\"unexpected next value: got false, exp true\")\n+\t}\n+\n+\tif v1 != dec.Read() {\n+\t\tt.Fatalf(\"unexpected value: got %v, exp %v\", dec.Read(), v1)\n+\t}\n+}\n+\n+func Test_BoolEncoder_Multi_Compressed(t *testing.T) {\n+\tenc := tsm1.NewBoolEncoder()\n+\n+\tvalues := make([]bool, 10)\n+\tfor i := range values {\n+\t\tvalues[i] = i%2 == 0\n+\t\tenc.Write(values[i])\n+\t}\n+\n+\tb, err := enc.Bytes()\n+\tif err != nil {\n+\t\tt.Fatalf(\"unexpected error: %v\", err)\n+\t}\n+\n+\tif exp := 4; len(b) != exp {","path":"tsdb/engine/tsm1/bool_test.go","position":55,"original_position":55,"commit_id":"851a53fd7002571bb8e1be7f9e20b3bfa1039c15","original_commit_id":"851a53fd7002571bb8e1be7f9e20b3bfa1039c15","user":{"login":"corylanou","id":585100,"avatar_url":"https://avatars.githubusercontent.com/u/585100?v=3","gravatar_id":"","url":"https://api.github.com/users/corylanou","html_url":"https://github.com/corylanou","followers_url":"https://api.github.com/users/corylanou/followers","following_url":"https://api.github.com/users/corylanou/following{/other_user}","gists_url":"https://api.github.com/users/corylanou/gists{/gist_id}","starred_url":"https://api.github.com/users/corylanou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corylanou/subscriptions","organizations_url":"https://api.github.com/users/corylanou/orgs","repos_url":"https://api.github.com/users/corylanou/repos","events_url":"https://api.github.com/users/corylanou/events{/privacy}","received_events_url":"https://api.github.com/users/corylanou/received_events","type":"User","site_admin":false},"body":"I tend to write these as:\r\n\r\n```go\r\nif exp, got := 4, len(b); exp != got {\r\n     t.Fatalf(\"unexpected length: got %v, exp %v\", got, exp)\r\n}\r\n```","created_at":"2015-10-05T11:56:32Z","updated_at":"2015-10-05T11:56:32Z","html_url":"https://github.com/influxdb/influxdb/pull/4308#discussion_r41135309","pull_request_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4308","_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/41135309"},"html":{"href":"https://github.com/influxdb/influxdb/pull/4308#discussion_r41135309"},"pull_request":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4308"}}},"pull_request":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/4308","id":46687247,"html_url":"https://github.com/influxdb/influxdb/pull/4308","diff_url":"https://github.com/influxdb/influxdb/pull/4308.diff","patch_url":"https://github.com/influxdb/influxdb/pull/4308.patch","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4308","number":4308,"state":"open","locked":false,"title":"The TSM storage engine","user":{"login":"pauldix","id":4331,"avatar_url":"https://avatars.githubusercontent.com/u/4331?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldix","html_url":"https://github.com/pauldix","followers_url":"https://api.github.com/users/pauldix/followers","following_url":"https://api.github.com/users/pauldix/following{/other_user}","gists_url":"https://api.github.com/users/pauldix/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldix/subscriptions","organizations_url":"https://api.github.com/users/pauldix/orgs","repos_url":"https://api.github.com/users/pauldix/repos","events_url":"https://api.github.com/users/pauldix/events{/privacy}","received_events_url":"https://api.github.com/users/pauldix/received_events","type":"User","site_admin":false},"body":"Internal people have seen the docs, external will see it soon. I haven't had a chance to refactor any of this yet, but let me have it. I'll be pushing up some refactoring changes over the weekend I think.\r\n\r\nWill fix the merge conflicts with the stress tool in a bit, but I wanted to get people commenting on the code so I can get some feedback and fixes in.","created_at":"2015-10-02T22:03:04Z","updated_at":"2015-10-05T11:56:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4308/commits","review_comments_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4308/comments","review_comment_url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4308/comments","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/851a53fd7002571bb8e1be7f9e20b3bfa1039c15","head":{"label":"influxdb:pd-storage-engine","ref":"pd-storage-engine","sha":"851a53fd7002571bb8e1be7f9e20b3bfa1039c15","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdb/influxdb","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdb/influxdb","forks_url":"https://api.github.com/repos/influxdb/influxdb/forks","keys_url":"https://api.github.com/repos/influxdb/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdb/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdb/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/influxdb/events","assignees_url":"https://api.github.com/repos/influxdb/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdb/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdb/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdb/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdb/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdb/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdb/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/influxdb/merges","archive_url":"https://api.github.com/repos/influxdb/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdb/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/influxdb/releases{/id}","created_at":"2013-09-26T14:31:10Z","updated_at":"2015-10-04T13:23:26Z","pushed_at":"2015-10-04T22:58:39Z","git_url":"git://github.com/influxdb/influxdb.git","ssh_url":"git@github.com:influxdb/influxdb.git","clone_url":"https://github.com/influxdb/influxdb.git","svn_url":"https://github.com/influxdb/influxdb","homepage":"http://influxdb.com","size":61797,"stargazers_count":6428,"watchers_count":6428,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":715,"mirror_url":null,"open_issues_count":365,"forks":715,"open_issues":365,"watchers":6428,"default_branch":"master"}},"base":{"label":"influxdb:master","ref":"master","sha":"d4fb66290a338e74b6027345117c589b90676bfa","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdb/influxdb","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdb/influxdb","forks_url":"https://api.github.com/repos/influxdb/influxdb/forks","keys_url":"https://api.github.com/repos/influxdb/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdb/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdb/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/influxdb/events","assignees_url":"https://api.github.com/repos/influxdb/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdb/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdb/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdb/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdb/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdb/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdb/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/influxdb/merges","archive_url":"https://api.github.com/repos/influxdb/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdb/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/influxdb/releases{/id}","created_at":"2013-09-26T14:31:10Z","updated_at":"2015-10-04T13:23:26Z","pushed_at":"2015-10-04T22:58:39Z","git_url":"git://github.com/influxdb/influxdb.git","ssh_url":"git@github.com:influxdb/influxdb.git","clone_url":"https://github.com/influxdb/influxdb.git","svn_url":"https://github.com/influxdb/influxdb","homepage":"http://influxdb.com","size":61797,"stargazers_count":6428,"watchers_count":6428,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":715,"mirror_url":null,"open_issues_count":365,"forks":715,"open_issues":365,"watchers":6428,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4308"},"html":{"href":"https://github.com/influxdb/influxdb/pull/4308"},"issue":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/4308"},"comments":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/4308/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4308/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4308/commits"},"statuses":{"href":"https://api.github.com/repos/influxdb/influxdb/statuses/851a53fd7002571bb8e1be7f9e20b3bfa1039c15"}}}}