{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/beats/pulls/comments/167455153","pull_request_review_id":95675082,"id":167455153,"diff_hunk":"@@ -0,0 +1,157 @@\n+package file\n+\n+import (\n+\t\"sync\"\n+\t\"time\"\n+\n+\t\"github.com/elastic/beats/libbeat/logp\"\n+)\n+\n+// States handles list of FileState. One must use NewStates to instantiate a\n+// file states regisry. Using the zero-value is not safe.\n+type States struct {\n+\tsync.RWMutex\n+\n+\t// states store\n+\tstates []State\n+\n+\t// idx maps state IDs to state indexes for fast lookup and modifications.\n+\tidx map[string]int","path":"filebeat/input/file/states.go","position":19,"original_position":19,"commit_id":"4f787a71be6b29fe93b497a9e79dbd4895dbf32e","original_commit_id":"4f787a71be6b29fe93b497a9e79dbd4895dbf32e","user":{"login":"ruflin","id":244900,"avatar_url":"https://avatars3.githubusercontent.com/u/244900?v=4","gravatar_id":"","url":"https://api.github.com/users/ruflin","html_url":"https://github.com/ruflin","followers_url":"https://api.github.com/users/ruflin/followers","following_url":"https://api.github.com/users/ruflin/following{/other_user}","gists_url":"https://api.github.com/users/ruflin/gists{/gist_id}","starred_url":"https://api.github.com/users/ruflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruflin/subscriptions","organizations_url":"https://api.github.com/users/ruflin/orgs","repos_url":"https://api.github.com/users/ruflin/repos","events_url":"https://api.github.com/users/ruflin/events{/privacy}","received_events_url":"https://api.github.com/users/ruflin/received_events","type":"User","site_admin":false},"body":"What is the reason you changed your mind to the separate map string for keeping track of the ids? ","created_at":"2018-02-11T23:37:58Z","updated_at":"2018-02-11T23:48:11Z","html_url":"https://github.com/elastic/beats/pull/6346#discussion_r167455153","pull_request_url":"https://api.github.com/repos/elastic/beats/pulls/6346","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/beats/pulls/comments/167455153"},"html":{"href":"https://github.com/elastic/beats/pull/6346#discussion_r167455153"},"pull_request":{"href":"https://api.github.com/repos/elastic/beats/pulls/6346"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/beats/pulls/6346","id":168273875,"html_url":"https://github.com/elastic/beats/pull/6346","diff_url":"https://github.com/elastic/beats/pull/6346.diff","patch_url":"https://github.com/elastic/beats/pull/6346.patch","issue_url":"https://api.github.com/repos/elastic/beats/issues/6346","number":6346,"state":"open","locked":false,"title":"Filebeat in memory states registry improvements","user":{"login":"urso","id":75886,"avatar_url":"https://avatars1.githubusercontent.com/u/75886?v=4","gravatar_id":"","url":"https://api.github.com/users/urso","html_url":"https://github.com/urso","followers_url":"https://api.github.com/users/urso/followers","following_url":"https://api.github.com/users/urso/following{/other_user}","gists_url":"https://api.github.com/users/urso/gists{/gist_id}","starred_url":"https://api.github.com/users/urso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urso/subscriptions","organizations_url":"https://api.github.com/users/urso/orgs","repos_url":"https://api.github.com/users/urso/repos","events_url":"https://api.github.com/users/urso/events{/privacy}","received_events_url":"https://api.github.com/users/urso/received_events","type":"User","site_admin":false},"body":"- make States type easier to find by moving into separate states.go file\r\n- Ensure provides States constructor is actually used\r\n- Add ID->array index, index for faster lookups on update and find\r\n  operations. When updating states in a big registry, the Updates\r\n  converged to quadratic complexity. The index helps in keeping the\r\n  complexity about linear in number of state updates.\r\n- Debug will print number of states subject to future cleanups (if state TTL > 0)\r\n- Add title to states unit tests","created_at":"2018-02-09T15:49:33Z","updated_at":"2018-02-11T23:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03211649be004c096ac1b302b4a62a0289cd6307","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tsg","id":101817,"avatar_url":"https://avatars1.githubusercontent.com/u/101817?v=4","gravatar_id":"","url":"https://api.github.com/users/tsg","html_url":"https://github.com/tsg","followers_url":"https://api.github.com/users/tsg/followers","following_url":"https://api.github.com/users/tsg/following{/other_user}","gists_url":"https://api.github.com/users/tsg/gists{/gist_id}","starred_url":"https://api.github.com/users/tsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsg/subscriptions","organizations_url":"https://api.github.com/users/tsg/orgs","repos_url":"https://api.github.com/users/tsg/repos","events_url":"https://api.github.com/users/tsg/events{/privacy}","received_events_url":"https://api.github.com/users/tsg/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/beats/pulls/6346/commits","review_comments_url":"https://api.github.com/repos/elastic/beats/pulls/6346/comments","review_comment_url":"https://api.github.com/repos/elastic/beats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/beats/issues/6346/comments","statuses_url":"https://api.github.com/repos/elastic/beats/statuses/4f787a71be6b29fe93b497a9e79dbd4895dbf32e","head":{"label":"urso:opt/filebeat-state-registry","ref":"opt/filebeat-state-registry","sha":"4f787a71be6b29fe93b497a9e79dbd4895dbf32e","user":{"login":"urso","id":75886,"avatar_url":"https://avatars1.githubusercontent.com/u/75886?v=4","gravatar_id":"","url":"https://api.github.com/users/urso","html_url":"https://github.com/urso","followers_url":"https://api.github.com/users/urso/followers","following_url":"https://api.github.com/users/urso/following{/other_user}","gists_url":"https://api.github.com/users/urso/gists{/gist_id}","starred_url":"https://api.github.com/users/urso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urso/subscriptions","organizations_url":"https://api.github.com/users/urso/orgs","repos_url":"https://api.github.com/users/urso/repos","events_url":"https://api.github.com/users/urso/events{/privacy}","received_events_url":"https://api.github.com/users/urso/received_events","type":"User","site_admin":false},"repo":{"id":40138298,"name":"beats","full_name":"urso/beats","owner":{"login":"urso","id":75886,"avatar_url":"https://avatars1.githubusercontent.com/u/75886?v=4","gravatar_id":"","url":"https://api.github.com/users/urso","html_url":"https://github.com/urso","followers_url":"https://api.github.com/users/urso/followers","following_url":"https://api.github.com/users/urso/following{/other_user}","gists_url":"https://api.github.com/users/urso/gists{/gist_id}","starred_url":"https://api.github.com/users/urso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urso/subscriptions","organizations_url":"https://api.github.com/users/urso/orgs","repos_url":"https://api.github.com/users/urso/repos","events_url":"https://api.github.com/users/urso/events{/privacy}","received_events_url":"https://api.github.com/users/urso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/urso/beats","description":"Open Source Real-Time Packet Analyzer","fork":true,"url":"https://api.github.com/repos/urso/beats","forks_url":"https://api.github.com/repos/urso/beats/forks","keys_url":"https://api.github.com/repos/urso/beats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urso/beats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urso/beats/teams","hooks_url":"https://api.github.com/repos/urso/beats/hooks","issue_events_url":"https://api.github.com/repos/urso/beats/issues/events{/number}","events_url":"https://api.github.com/repos/urso/beats/events","assignees_url":"https://api.github.com/repos/urso/beats/assignees{/user}","branches_url":"https://api.github.com/repos/urso/beats/branches{/branch}","tags_url":"https://api.github.com/repos/urso/beats/tags","blobs_url":"https://api.github.com/repos/urso/beats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urso/beats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urso/beats/git/refs{/sha}","trees_url":"https://api.github.com/repos/urso/beats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urso/beats/statuses/{sha}","languages_url":"https://api.github.com/repos/urso/beats/languages","stargazers_url":"https://api.github.com/repos/urso/beats/stargazers","contributors_url":"https://api.github.com/repos/urso/beats/contributors","subscribers_url":"https://api.github.com/repos/urso/beats/subscribers","subscription_url":"https://api.github.com/repos/urso/beats/subscription","commits_url":"https://api.github.com/repos/urso/beats/commits{/sha}","git_commits_url":"https://api.github.com/repos/urso/beats/git/commits{/sha}","comments_url":"https://api.github.com/repos/urso/beats/comments{/number}","issue_comment_url":"https://api.github.com/repos/urso/beats/issues/comments{/number}","contents_url":"https://api.github.com/repos/urso/beats/contents/{+path}","compare_url":"https://api.github.com/repos/urso/beats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urso/beats/merges","archive_url":"https://api.github.com/repos/urso/beats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urso/beats/downloads","issues_url":"https://api.github.com/repos/urso/beats/issues{/number}","pulls_url":"https://api.github.com/repos/urso/beats/pulls{/number}","milestones_url":"https://api.github.com/repos/urso/beats/milestones{/number}","notifications_url":"https://api.github.com/repos/urso/beats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urso/beats/labels{/name}","releases_url":"https://api.github.com/repos/urso/beats/releases{/id}","deployments_url":"https://api.github.com/repos/urso/beats/deployments","created_at":"2015-08-03T17:25:21Z","updated_at":"2016-10-28T12:16:33Z","pushed_at":"2018-02-10T00:02:02Z","git_url":"git://github.com/urso/beats.git","ssh_url":"git@github.com:urso/beats.git","clone_url":"https://github.com/urso/beats.git","svn_url":"https://github.com/urso/beats","homepage":"https://www.elastic.co/products/beats/packetbeat","size":72418,"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,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"545938e899c9f085a9b3b7d1d8dd119c139c7a90","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":16554739,"name":"beats","full_name":"elastic/beats","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/beats","description":":tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash ","fork":false,"url":"https://api.github.com/repos/elastic/beats","forks_url":"https://api.github.com/repos/elastic/beats/forks","keys_url":"https://api.github.com/repos/elastic/beats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/beats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/beats/teams","hooks_url":"https://api.github.com/repos/elastic/beats/hooks","issue_events_url":"https://api.github.com/repos/elastic/beats/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/beats/events","assignees_url":"https://api.github.com/repos/elastic/beats/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/beats/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/beats/tags","blobs_url":"https://api.github.com/repos/elastic/beats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/beats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/beats/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/beats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/beats/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/beats/languages","stargazers_url":"https://api.github.com/repos/elastic/beats/stargazers","contributors_url":"https://api.github.com/repos/elastic/beats/contributors","subscribers_url":"https://api.github.com/repos/elastic/beats/subscribers","subscription_url":"https://api.github.com/repos/elastic/beats/subscription","commits_url":"https://api.github.com/repos/elastic/beats/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/beats/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/beats/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/beats/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/beats/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/beats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/beats/merges","archive_url":"https://api.github.com/repos/elastic/beats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/beats/downloads","issues_url":"https://api.github.com/repos/elastic/beats/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/beats/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/beats/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/beats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/beats/labels{/name}","releases_url":"https://api.github.com/repos/elastic/beats/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/beats/deployments","created_at":"2014-02-05T19:01:02Z","updated_at":"2018-02-11T19:12:37Z","pushed_at":"2018-02-11T23:35:55Z","git_url":"git://github.com/elastic/beats.git","ssh_url":"git@github.com:elastic/beats.git","clone_url":"https://github.com/elastic/beats.git","svn_url":"https://github.com/elastic/beats","homepage":"https://www.elastic.co/products/beats","size":73146,"stargazers_count":5199,"watchers_count":5199,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1447,"mirror_url":null,"archived":false,"open_issues_count":721,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1447,"open_issues":721,"watchers":5199,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/beats/pulls/6346"},"html":{"href":"https://github.com/elastic/beats/pull/6346"},"issue":{"href":"https://api.github.com/repos/elastic/beats/issues/6346"},"comments":{"href":"https://api.github.com/repos/elastic/beats/issues/6346/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/beats/pulls/6346/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/beats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/beats/pulls/6346/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/beats/statuses/4f787a71be6b29fe93b497a9e79dbd4895dbf32e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ruflin"}}