{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/74590529","id":74590529,"diff_hunk":"@@ -46,16 +49,22 @@ protected OperationFactory createOperationFactory() {\n \n     @Override\n     protected Object reduce(Map<Integer, Object> map) {\n-        int totalAffectedEntries = 0;\n+        int clearedTotal = 0;\n         for (Object affectedEntries : map.values()) {\n-            totalAffectedEntries += (Integer) affectedEntries;\n+            clearedTotal += (Integer) affectedEntries;\n         }\n-        final MapService service = getService(MapService.SERVICE_NAME);\n-        final Address thisAddress = service.getMapServiceContext().getNodeEngine().getThisAddress();\n-        if (totalAffectedEntries > 0) {\n-            service.getMapServiceContext().getMapEventPublisher()\n-                    .publishMapEvent(thisAddress, parameters.name, EntryEventType.CLEAR_ALL, totalAffectedEntries);\n+\n+        MapService service = getService(MapService.SERVICE_NAME);\n+        MapServiceContext mapServiceContext = service.getMapServiceContext();\n+\n+        if (clearedTotal > 0) {","path":"hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/map/MapClearMessageTask.java","position":40,"original_position":40,"commit_id":"92c8cbacea944d780a3ca04a34864052ff622aa7","original_commit_id":"92c8cbacea944d780a3ca04a34864052ff622aa7","user":{"login":"ihsandemir","id":7543261,"avatar_url":"https://avatars.githubusercontent.com/u/7543261?v=3","gravatar_id":"","url":"https://api.github.com/users/ihsandemir","html_url":"https://github.com/ihsandemir","followers_url":"https://api.github.com/users/ihsandemir/followers","following_url":"https://api.github.com/users/ihsandemir/following{/other_user}","gists_url":"https://api.github.com/users/ihsandemir/gists{/gist_id}","starred_url":"https://api.github.com/users/ihsandemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihsandemir/subscriptions","organizations_url":"https://api.github.com/users/ihsandemir/orgs","repos_url":"https://api.github.com/users/ihsandemir/repos","events_url":"https://api.github.com/users/ihsandemir/events{/privacy}","received_events_url":"https://api.github.com/users/ihsandemir/received_events","type":"User","site_admin":false},"body":"Should we send the event regardless of this number? It is possible that the cache became empty after client called clear before the response is returned to the client. Therefore, it will be safer to send this event regardless.","created_at":"2016-08-12T13:32:09Z","updated_at":"2016-08-12T13:32:09Z","html_url":"https://github.com/hazelcast/hazelcast/pull/8697#discussion_r74590529","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/74590529"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/8697#discussion_r74590529"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697","id":80790758,"html_url":"https://github.com/hazelcast/hazelcast/pull/8697","diff_url":"https://github.com/hazelcast/hazelcast/pull/8697.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/8697.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8697","number":8697,"state":"open","locked":false,"title":"Makes imap#clear and imap#evictAll to send only one clear event to clients near-cache-invalidation-listener","user":{"login":"ahmetmircik","id":2960360,"avatar_url":"https://avatars.githubusercontent.com/u/2960360?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetmircik","html_url":"https://github.com/ahmetmircik","followers_url":"https://api.github.com/users/ahmetmircik/followers","following_url":"https://api.github.com/users/ahmetmircik/following{/other_user}","gists_url":"https://api.github.com/users/ahmetmircik/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetmircik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetmircik/subscriptions","organizations_url":"https://api.github.com/users/ahmetmircik/orgs","repos_url":"https://api.github.com/users/ahmetmircik/repos","events_url":"https://api.github.com/users/ahmetmircik/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetmircik/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-10T13:09:16Z","updated_at":"2016-08-12T13:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57b969dcd9d9090ff7e8872e8cf7ca6b378363ca","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/76","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.8","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/76/labels","id":1774122,"number":76,"title":"3.8","description":"","creator":{"login":"degerhz","id":8373100,"avatar_url":"https://avatars.githubusercontent.com/u/8373100?v=3","gravatar_id":"","url":"https://api.github.com/users/degerhz","html_url":"https://github.com/degerhz","followers_url":"https://api.github.com/users/degerhz/followers","following_url":"https://api.github.com/users/degerhz/following{/other_user}","gists_url":"https://api.github.com/users/degerhz/gists{/gist_id}","starred_url":"https://api.github.com/users/degerhz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degerhz/subscriptions","organizations_url":"https://api.github.com/users/degerhz/orgs","repos_url":"https://api.github.com/users/degerhz/repos","events_url":"https://api.github.com/users/degerhz/events{/privacy}","received_events_url":"https://api.github.com/users/degerhz/received_events","type":"User","site_admin":false},"open_issues":102,"closed_issues":13,"state":"open","created_at":"2016-05-18T14:13:56Z","updated_at":"2016-08-12T13:02:57Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8697/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/92c8cbacea944d780a3ca04a34864052ff622aa7","head":{"label":"ahmetmircik:fix/3.8/lotsOfClearEventToNeaarCacheFix","ref":"fix/3.8/lotsOfClearEventToNeaarCacheFix","sha":"92c8cbacea944d780a3ca04a34864052ff622aa7","user":{"login":"ahmetmircik","id":2960360,"avatar_url":"https://avatars.githubusercontent.com/u/2960360?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetmircik","html_url":"https://github.com/ahmetmircik","followers_url":"https://api.github.com/users/ahmetmircik/followers","following_url":"https://api.github.com/users/ahmetmircik/following{/other_user}","gists_url":"https://api.github.com/users/ahmetmircik/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetmircik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetmircik/subscriptions","organizations_url":"https://api.github.com/users/ahmetmircik/orgs","repos_url":"https://api.github.com/users/ahmetmircik/repos","events_url":"https://api.github.com/users/ahmetmircik/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetmircik/received_events","type":"User","site_admin":false},"repo":{"id":13222351,"name":"hazelcast","full_name":"ahmetmircik/hazelcast","owner":{"login":"ahmetmircik","id":2960360,"avatar_url":"https://avatars.githubusercontent.com/u/2960360?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetmircik","html_url":"https://github.com/ahmetmircik","followers_url":"https://api.github.com/users/ahmetmircik/followers","following_url":"https://api.github.com/users/ahmetmircik/following{/other_user}","gists_url":"https://api.github.com/users/ahmetmircik/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetmircik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetmircik/subscriptions","organizations_url":"https://api.github.com/users/ahmetmircik/orgs","repos_url":"https://api.github.com/users/ahmetmircik/repos","events_url":"https://api.github.com/users/ahmetmircik/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetmircik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ahmetmircik/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/ahmetmircik/hazelcast","forks_url":"https://api.github.com/repos/ahmetmircik/hazelcast/forks","keys_url":"https://api.github.com/repos/ahmetmircik/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ahmetmircik/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ahmetmircik/hazelcast/teams","hooks_url":"https://api.github.com/repos/ahmetmircik/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/ahmetmircik/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/ahmetmircik/hazelcast/events","assignees_url":"https://api.github.com/repos/ahmetmircik/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/ahmetmircik/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/ahmetmircik/hazelcast/tags","blobs_url":"https://api.github.com/repos/ahmetmircik/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ahmetmircik/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ahmetmircik/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/ahmetmircik/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ahmetmircik/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/ahmetmircik/hazelcast/languages","stargazers_url":"https://api.github.com/repos/ahmetmircik/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/ahmetmircik/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/ahmetmircik/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/ahmetmircik/hazelcast/subscription","commits_url":"https://api.github.com/repos/ahmetmircik/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/ahmetmircik/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/ahmetmircik/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/ahmetmircik/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/ahmetmircik/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/ahmetmircik/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ahmetmircik/hazelcast/merges","archive_url":"https://api.github.com/repos/ahmetmircik/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ahmetmircik/hazelcast/downloads","issues_url":"https://api.github.com/repos/ahmetmircik/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/ahmetmircik/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/ahmetmircik/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/ahmetmircik/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ahmetmircik/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/ahmetmircik/hazelcast/releases{/id}","deployments_url":"https://api.github.com/repos/ahmetmircik/hazelcast/deployments","created_at":"2013-09-30T17:48:20Z","updated_at":"2015-08-13T09:42:50Z","pushed_at":"2016-08-11T16:01:58Z","git_url":"git://github.com/ahmetmircik/hazelcast.git","ssh_url":"git@github.com:ahmetmircik/hazelcast.git","clone_url":"https://github.com/ahmetmircik/hazelcast.git","svn_url":"https://github.com/ahmetmircik/hazelcast","homepage":"www.hazelcast.com","size":96268,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hazelcast:master","ref":"master","sha":"27a44f6090bb946b69aa3f724bfbe51558d8ca39","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","deployments_url":"https://api.github.com/repos/hazelcast/hazelcast/deployments","created_at":"2012-03-21T12:25:18Z","updated_at":"2016-08-12T10:27:49Z","pushed_at":"2016-08-12T13:03:11Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":130772,"stargazers_count":1680,"watchers_count":1680,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":784,"mirror_url":null,"open_issues_count":528,"forks":784,"open_issues":528,"watchers":1680,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/8697"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/8697"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/8697/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/8697/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/92c8cbacea944d780a3ca04a34864052ff622aa7"}}}}
{"actor":{"display_login":"ihsandemir"}}