{"action":"created","comment":{"url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments/202424205","pull_request_review_id":137128065,"id":202424205,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjQyNDIwNQ==","diff_hunk":"@@ -65,19 +64,18 @@ void MetadataStore::UpdateMetadata(const std::string& full_resource_name,\n   }\n   // Force value update. The repeated search is inefficient, but shouldn't\n   // be a huge deal.\n-  metadata_map_.erase(full_resource_name);\n-  metadata_map_.emplace(full_resource_name, std::move(entry));\n+  const MetadataKey metadata_key{entry.name, entry.version};\n+  metadata_map_.erase(metadata_key);\n+  metadata_map_.emplace(metadata_key, std::move(entry));\n }\n \n-std::map<std::string, MetadataStore::Metadata>\n-    MetadataStore::GetMetadataMap() const {\n+std::vector<MetadataStore::Metadata> MetadataStore::GetMetadataList() const {\n   std::lock_guard<std::mutex> lock(metadata_mu_);\n \n-  std::map<std::string, Metadata> result;\n+  std::vector<Metadata> result;\n   for (const auto& kv : metadata_map_) {\n-    const std::string& full_resource_name = kv.first;\n     const Metadata& metadata = kv.second;\n-    result.emplace(full_resource_name, metadata.Clone());\n+    result.push_back(metadata.Clone());","path":"src/store.cc","position":40,"original_position":40,"commit_id":"ac4e1aa5deab279a385867e57815d146cad6d5f3","original_commit_id":"ac4e1aa5deab279a385867e57815d146cad6d5f3","user":{"login":"igorpeshansky","id":7594381,"node_id":"MDQ6VXNlcjc1OTQzODE=","avatar_url":"https://avatars1.githubusercontent.com/u/7594381?v=4","gravatar_id":"","url":"https://api.github.com/users/igorpeshansky","html_url":"https://github.com/igorpeshansky","followers_url":"https://api.github.com/users/igorpeshansky/followers","following_url":"https://api.github.com/users/igorpeshansky/following{/other_user}","gists_url":"https://api.github.com/users/igorpeshansky/gists{/gist_id}","starred_url":"https://api.github.com/users/igorpeshansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorpeshansky/subscriptions","organizations_url":"https://api.github.com/users/igorpeshansky/orgs","repos_url":"https://api.github.com/users/igorpeshansky/repos","events_url":"https://api.github.com/users/igorpeshansky/events{/privacy}","received_events_url":"https://api.github.com/users/igorpeshansky/received_events","type":"User","site_admin":false},"body":"Note: `emplace_back` would work better.","created_at":"2018-07-13T17:41:05Z","updated_at":"2018-07-13T18:00:21Z","html_url":"https://github.com/Stackdriver/metadata-agent/pull/158#discussion_r202424205","pull_request_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments/202424205"},"html":{"href":"https://github.com/Stackdriver/metadata-agent/pull/158#discussion_r202424205"},"pull_request":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158","id":199082955,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MDgyOTU1","html_url":"https://github.com/Stackdriver/metadata-agent/pull/158","diff_url":"https://github.com/Stackdriver/metadata-agent/pull/158.diff","patch_url":"https://github.com/Stackdriver/metadata-agent/pull/158.patch","issue_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/158","number":158,"state":"open","locked":false,"title":"Update the metadata store to use version in the metadata key.","user":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-03T21:05:40Z","updated_at":"2018-07-13T18:00:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d24fa7e1fe71f625304f5adc4260e43e3c7ca39","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":971766958,"node_id":"MDU6TGFiZWw5NzE3NjY5NTg=","url":"https://api.github.com/repos/Stackdriver/metadata-agent/labels/v1beta3","name":"v1beta3","color":"d3a03b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158/commits","review_comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158/comments","review_comment_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/158/comments","statuses_url":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/ac4e1aa5deab279a385867e57815d146cad6d5f3","head":{"label":"supriyagarg:add_version","ref":"add_version","sha":"ac4e1aa5deab279a385867e57815d146cad6d5f3","user":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"repo":{"id":118942349,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5NDIzNDk=","name":"metadata-agent","full_name":"supriyagarg/metadata-agent","owner":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supriyagarg/metadata-agent","description":"Stackdriver metadata agent","fork":true,"url":"https://api.github.com/repos/supriyagarg/metadata-agent","forks_url":"https://api.github.com/repos/supriyagarg/metadata-agent/forks","keys_url":"https://api.github.com/repos/supriyagarg/metadata-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supriyagarg/metadata-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supriyagarg/metadata-agent/teams","hooks_url":"https://api.github.com/repos/supriyagarg/metadata-agent/hooks","issue_events_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues/events{/number}","events_url":"https://api.github.com/repos/supriyagarg/metadata-agent/events","assignees_url":"https://api.github.com/repos/supriyagarg/metadata-agent/assignees{/user}","branches_url":"https://api.github.com/repos/supriyagarg/metadata-agent/branches{/branch}","tags_url":"https://api.github.com/repos/supriyagarg/metadata-agent/tags","blobs_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supriyagarg/metadata-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/supriyagarg/metadata-agent/languages","stargazers_url":"https://api.github.com/repos/supriyagarg/metadata-agent/stargazers","contributors_url":"https://api.github.com/repos/supriyagarg/metadata-agent/contributors","subscribers_url":"https://api.github.com/repos/supriyagarg/metadata-agent/subscribers","subscription_url":"https://api.github.com/repos/supriyagarg/metadata-agent/subscription","commits_url":"https://api.github.com/repos/supriyagarg/metadata-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/supriyagarg/metadata-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/supriyagarg/metadata-agent/contents/{+path}","compare_url":"https://api.github.com/repos/supriyagarg/metadata-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supriyagarg/metadata-agent/merges","archive_url":"https://api.github.com/repos/supriyagarg/metadata-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supriyagarg/metadata-agent/downloads","issues_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues{/number}","pulls_url":"https://api.github.com/repos/supriyagarg/metadata-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/supriyagarg/metadata-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/supriyagarg/metadata-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supriyagarg/metadata-agent/labels{/name}","releases_url":"https://api.github.com/repos/supriyagarg/metadata-agent/releases{/id}","deployments_url":"https://api.github.com/repos/supriyagarg/metadata-agent/deployments","created_at":"2018-01-25T17:03:49Z","updated_at":"2018-06-21T21:37:46Z","pushed_at":"2018-07-11T01:22:25Z","git_url":"git://github.com/supriyagarg/metadata-agent.git","ssh_url":"git@github.com:supriyagarg/metadata-agent.git","clone_url":"https://github.com/supriyagarg/metadata-agent.git","svn_url":"https://github.com/supriyagarg/metadata-agent","homepage":"","size":503,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Stackdriver:v1beta3-working-branch","ref":"v1beta3-working-branch","sha":"6cd64724129e2fc92feee4551725711621416891","user":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"repo":{"id":81396310,"node_id":"MDEwOlJlcG9zaXRvcnk4MTM5NjMxMA==","name":"metadata-agent","full_name":"Stackdriver/metadata-agent","owner":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Stackdriver/metadata-agent","description":"Stackdriver metadata agent","fork":false,"url":"https://api.github.com/repos/Stackdriver/metadata-agent","forks_url":"https://api.github.com/repos/Stackdriver/metadata-agent/forks","keys_url":"https://api.github.com/repos/Stackdriver/metadata-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stackdriver/metadata-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stackdriver/metadata-agent/teams","hooks_url":"https://api.github.com/repos/Stackdriver/metadata-agent/hooks","issue_events_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Stackdriver/metadata-agent/events","assignees_url":"https://api.github.com/repos/Stackdriver/metadata-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Stackdriver/metadata-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Stackdriver/metadata-agent/tags","blobs_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Stackdriver/metadata-agent/languages","stargazers_url":"https://api.github.com/repos/Stackdriver/metadata-agent/stargazers","contributors_url":"https://api.github.com/repos/Stackdriver/metadata-agent/contributors","subscribers_url":"https://api.github.com/repos/Stackdriver/metadata-agent/subscribers","subscription_url":"https://api.github.com/repos/Stackdriver/metadata-agent/subscription","commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stackdriver/metadata-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Stackdriver/metadata-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stackdriver/metadata-agent/merges","archive_url":"https://api.github.com/repos/Stackdriver/metadata-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stackdriver/metadata-agent/downloads","issues_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Stackdriver/metadata-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Stackdriver/metadata-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stackdriver/metadata-agent/labels{/name}","releases_url":"https://api.github.com/repos/Stackdriver/metadata-agent/releases{/id}","deployments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/deployments","created_at":"2017-02-09T01:48:50Z","updated_at":"2018-07-13T16:31:43Z","pushed_at":"2018-07-13T16:31:43Z","git_url":"git://github.com/Stackdriver/metadata-agent.git","ssh_url":"git@github.com:Stackdriver/metadata-agent.git","clone_url":"https://github.com/Stackdriver/metadata-agent.git","svn_url":"https://github.com/Stackdriver/metadata-agent","homepage":"","size":504,"stargazers_count":10,"watchers_count":10,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":14,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158"},"html":{"href":"https://github.com/Stackdriver/metadata-agent/pull/158"},"issue":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/158"},"comments":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/ac4e1aa5deab279a385867e57815d146cad6d5f3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"igorpeshansky"}}