{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments/108569156","pull_request_review_id":29606551,"id":108569156,"diff_hunk":"@@ -137,6 +139,46 @@\n   private static final Entity ENTITY3 = Entity.newBuilder(ENTITY1).setKey(KEY3).remove(\"str\")\n       .set(\"null\", NULL_VALUE).set(\"partial1\", PARTIAL_ENTITY2).set(\"partial2\", ENTITY2).build();\n \n+  private <T> Iterator<T> getStronglyConsistentResults (Query scQuery, Query query) {\n+    QueryResults<T> scResults = DATASTORE.run(scQuery);\n+    List<T> scResultsCopy = makeResultsCopy(scResults);\n+    Set<T> scResultsSet = new HashSet<>(scResultsCopy);","path":"google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java","position":45,"original_position":45,"commit_id":"ca1cd4225f6a6018c49ba5cb91ca52fbc56dc750","original_commit_id":"ca1cd4225f6a6018c49ba5cb91ca52fbc56dc750","user":{"login":"vam-google","id":25311427,"avatar_url":"https://avatars0.githubusercontent.com/u/25311427?v=3","gravatar_id":"","url":"https://api.github.com/users/vam-google","html_url":"https://github.com/vam-google","followers_url":"https://api.github.com/users/vam-google/followers","following_url":"https://api.github.com/users/vam-google/following{/other_user}","gists_url":"https://api.github.com/users/vam-google/gists{/gist_id}","starred_url":"https://api.github.com/users/vam-google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vam-google/subscriptions","organizations_url":"https://api.github.com/users/vam-google/orgs","repos_url":"https://api.github.com/users/vam-google/repos","events_url":"https://api.github.com/users/vam-google/events{/privacy}","received_events_url":"https://api.github.com/users/vam-google/received_events","type":"User","site_admin":false},"body":"\r\n\r\nThis will work only if the query returns only distinct results. Is it guaranteed to return distinct result items all the time? This is also under assumption, that equals and hascode are properly defined fro the result items.\r\n\r\nPlease (at least) provide a comment mentioning that the items in the result must be unique.\r\n","created_at":"2017-03-29T00:25:30Z","updated_at":"2017-03-29T00:51:23Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806#discussion_r108569156","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments/108569156"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806#discussion_r108569156"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806","id":112350366,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/1806","number":1806,"state":"open","locked":false,"title":"force query results to become strongly consistent","user":{"login":"neozwu","id":25352356,"avatar_url":"https://avatars1.githubusercontent.com/u/25352356?v=3","gravatar_id":"","url":"https://api.github.com/users/neozwu","html_url":"https://github.com/neozwu","followers_url":"https://api.github.com/users/neozwu/followers","following_url":"https://api.github.com/users/neozwu/following{/other_user}","gists_url":"https://api.github.com/users/neozwu/gists{/gist_id}","starred_url":"https://api.github.com/users/neozwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neozwu/subscriptions","organizations_url":"https://api.github.com/users/neozwu/orgs","repos_url":"https://api.github.com/users/neozwu/repos","events_url":"https://api.github.com/users/neozwu/events{/privacy}","received_events_url":"https://api.github.com/users/neozwu/received_events","type":"User","site_admin":false},"body":"Outside transactions, global queries of google cloud datastore utilize eventually consistent model - this means query results are not guaranteed to be updated. To facilitate deterministic testing, a helper method is implemented to force strong consistency for global queries.  It leverages the fact that any queries with ancestor filter will become strongly consistent queries.","created_at":"2017-03-23T22:16:41Z","updated_at":"2017-03-29T00:51:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdb9a34dcc22bfe9cffd4eb976da244d2cf95892","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/1806/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/ca1cd4225f6a6018c49ba5cb91ca52fbc56dc750","head":{"label":"neozwu:force-strong-consistency","ref":"force-strong-consistency","sha":"ca1cd4225f6a6018c49ba5cb91ca52fbc56dc750","user":{"login":"neozwu","id":25352356,"avatar_url":"https://avatars1.githubusercontent.com/u/25352356?v=3","gravatar_id":"","url":"https://api.github.com/users/neozwu","html_url":"https://github.com/neozwu","followers_url":"https://api.github.com/users/neozwu/followers","following_url":"https://api.github.com/users/neozwu/following{/other_user}","gists_url":"https://api.github.com/users/neozwu/gists{/gist_id}","starred_url":"https://api.github.com/users/neozwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neozwu/subscriptions","organizations_url":"https://api.github.com/users/neozwu/orgs","repos_url":"https://api.github.com/users/neozwu/repos","events_url":"https://api.github.com/users/neozwu/events{/privacy}","received_events_url":"https://api.github.com/users/neozwu/received_events","type":"User","site_admin":false},"repo":{"id":80548645,"name":"google-cloud-java","full_name":"neozwu/google-cloud-java","owner":{"login":"neozwu","id":25352356,"avatar_url":"https://avatars1.githubusercontent.com/u/25352356?v=3","gravatar_id":"","url":"https://api.github.com/users/neozwu","html_url":"https://github.com/neozwu","followers_url":"https://api.github.com/users/neozwu/followers","following_url":"https://api.github.com/users/neozwu/following{/other_user}","gists_url":"https://api.github.com/users/neozwu/gists{/gist_id}","starred_url":"https://api.github.com/users/neozwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neozwu/subscriptions","organizations_url":"https://api.github.com/users/neozwu/orgs","repos_url":"https://api.github.com/users/neozwu/repos","events_url":"https://api.github.com/users/neozwu/events{/privacy}","received_events_url":"https://api.github.com/users/neozwu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neozwu/google-cloud-java","description":"Google Cloud Client Library for Java","fork":true,"url":"https://api.github.com/repos/neozwu/google-cloud-java","forks_url":"https://api.github.com/repos/neozwu/google-cloud-java/forks","keys_url":"https://api.github.com/repos/neozwu/google-cloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neozwu/google-cloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neozwu/google-cloud-java/teams","hooks_url":"https://api.github.com/repos/neozwu/google-cloud-java/hooks","issue_events_url":"https://api.github.com/repos/neozwu/google-cloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/neozwu/google-cloud-java/events","assignees_url":"https://api.github.com/repos/neozwu/google-cloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/neozwu/google-cloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/neozwu/google-cloud-java/tags","blobs_url":"https://api.github.com/repos/neozwu/google-cloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neozwu/google-cloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neozwu/google-cloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/neozwu/google-cloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neozwu/google-cloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/neozwu/google-cloud-java/languages","stargazers_url":"https://api.github.com/repos/neozwu/google-cloud-java/stargazers","contributors_url":"https://api.github.com/repos/neozwu/google-cloud-java/contributors","subscribers_url":"https://api.github.com/repos/neozwu/google-cloud-java/subscribers","subscription_url":"https://api.github.com/repos/neozwu/google-cloud-java/subscription","commits_url":"https://api.github.com/repos/neozwu/google-cloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/neozwu/google-cloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/neozwu/google-cloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/neozwu/google-cloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/neozwu/google-cloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/neozwu/google-cloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neozwu/google-cloud-java/merges","archive_url":"https://api.github.com/repos/neozwu/google-cloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neozwu/google-cloud-java/downloads","issues_url":"https://api.github.com/repos/neozwu/google-cloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/neozwu/google-cloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/neozwu/google-cloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/neozwu/google-cloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neozwu/google-cloud-java/labels{/name}","releases_url":"https://api.github.com/repos/neozwu/google-cloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/neozwu/google-cloud-java/deployments","created_at":"2017-01-31T18:26:41Z","updated_at":"2017-01-31T18:26:46Z","pushed_at":"2017-03-28T23:57:52Z","git_url":"git://github.com/neozwu/google-cloud-java.git","ssh_url":"git@github.com:neozwu/google-cloud-java.git","clone_url":"https://github.com/neozwu/google-cloud-java.git","svn_url":"https://github.com/neozwu/google-cloud-java","homepage":"http://googlecloudplatform.github.io/google-cloud-java/","size":83054,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"GoogleCloudPlatform:master","ref":"master","sha":"afdb204c3529699c8ea3ccc7e32d3795c06e7819","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars3.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":26181278,"name":"google-cloud-java","full_name":"GoogleCloudPlatform/google-cloud-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars3.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java","description":"Google Cloud Client Library for Java","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/deployments","created_at":"2014-11-04T17:57:16Z","updated_at":"2017-03-28T16:22:44Z","pushed_at":"2017-03-29T00:32:50Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-java.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-java.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-java","homepage":"http://googlecloudplatform.github.io/google-cloud-java/","size":115536,"stargazers_count":274,"watchers_count":274,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":159,"mirror_url":null,"open_issues_count":199,"forks":159,"open_issues":199,"watchers":274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1806"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/1806"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/1806/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/1806/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/ca1cd4225f6a6018c49ba5cb91ca52fbc56dc750"}}}}
{"actor":{"display_login":"vam-google"}}