{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/93600927","pull_request_review_id":14131418,"id":93600927,"diff_hunk":"@@ -200,6 +235,38 @@ public void testIngestLocal() throws Exception {\n         verifyZeroInteractions(transportService);\n     }\n \n+    public void testSingleItemBulkActionIngestLocal() throws Exception {\n+        Exception exception = new Exception(\"fake exception\");\n+        IndexRequest indexRequest = new IndexRequest(\"index\", \"type\", \"id\");\n+        indexRequest.source(Collections.emptyMap());\n+        indexRequest.setPipeline(\"testpipeline\");\n+        AtomicBoolean responseCalled = new AtomicBoolean(false);\n+        AtomicBoolean failureCalled = new AtomicBoolean(false);\n+        singleItemBulkWriteAction.execute(null, indexRequest, ActionListener.wrap(\n+                response -> {\n+                    responseCalled.set(true);\n+                },\n+                e -> {\n+                    assertThat(e, sameInstance(exception));\n+                    failureCalled.set(true);\n+                }));\n+\n+        // check failure works, and passes through to the listener\n+        assertFalse(action.isExecuted); // haven't executed yet\n+        assertFalse(responseCalled.get());\n+        assertFalse(failureCalled.get());\n+        verify(executionService).executeBulkRequest(bulkDocsItr.capture(), failureHandler.capture(), completionHandler.capture());\n+        completionHandler.getValue().accept(exception);\n+        assertTrue(failureCalled.get());\n+\n+        // now check success\n+        indexRequest.setPipeline(null); // this is done by the real pipeline execution service when processing\n+        completionHandler.getValue().accept(null);\n+        assertTrue(action.isExecuted);\n+        assertFalse(responseCalled.get()); // listener would only be called by real index action, not our mocked one\n+        verifyZeroInteractions(transportService);","path":"core/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIngestTests.java","position":125,"original_position":125,"commit_id":"d51f414ea32b6e6ca63aa9c2250e750445b33d8c","original_commit_id":"d51f414ea32b6e6ca63aa9c2250e750445b33d8c","user":{"login":"martijnvg","id":580421,"avatar_url":"https://avatars.githubusercontent.com/u/580421?v=3","gravatar_id":"","url":"https://api.github.com/users/martijnvg","html_url":"https://github.com/martijnvg","followers_url":"https://api.github.com/users/martijnvg/followers","following_url":"https://api.github.com/users/martijnvg/following{/other_user}","gists_url":"https://api.github.com/users/martijnvg/gists{/gist_id}","starred_url":"https://api.github.com/users/martijnvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martijnvg/subscriptions","organizations_url":"https://api.github.com/users/martijnvg/orgs","repos_url":"https://api.github.com/users/martijnvg/repos","events_url":"https://api.github.com/users/martijnvg/events{/privacy}","received_events_url":"https://api.github.com/users/martijnvg/received_events","type":"User","site_admin":false},"body":"I think we should also verify that interaction happened with `ingestService` mock here?","created_at":"2016-12-22T10:42:01Z","updated_at":"2016-12-22T10:42:20Z","html_url":"https://github.com/elastic/elasticsearch/pull/21964#discussion_r93600927","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/93600927"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/21964#discussion_r93600927"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964","id":96469570,"html_url":"https://github.com/elastic/elasticsearch/pull/21964","diff_url":"https://github.com/elastic/elasticsearch/pull/21964.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/21964.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/21964","number":21964,"state":"open","locked":false,"title":"Make index and delete operation execute as a single bulk item","user":{"login":"areek","id":753679,"avatar_url":"https://avatars.githubusercontent.com/u/753679?v=3","gravatar_id":"","url":"https://api.github.com/users/areek","html_url":"https://github.com/areek","followers_url":"https://api.github.com/users/areek/followers","following_url":"https://api.github.com/users/areek/following{/other_user}","gists_url":"https://api.github.com/users/areek/gists{/gist_id}","starred_url":"https://api.github.com/users/areek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/areek/subscriptions","organizations_url":"https://api.github.com/users/areek/orgs","repos_url":"https://api.github.com/users/areek/repos","events_url":"https://api.github.com/users/areek/events{/privacy}","received_events_url":"https://api.github.com/users/areek/received_events","type":"User","site_admin":false},"body":"Performance testing by @danielmitterdorfer revealed single\r\nindex/delete operations have similar performance (indexing\r\nthroughput) to equivalent single item bulk request.\r\nThis PR reduces the code paths to executing single write\r\noperations, by reusing the logic in (shard) bulk action for\r\nexecuting single operation as a single-item bulk request.","created_at":"2016-12-05T04:58:52Z","updated_at":"2016-12-22T10:42:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aac0f91f4faf140035d2d59e671c4e472c19205f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/21964/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/d51f414ea32b6e6ca63aa9c2250e750445b33d8c","head":{"label":"areek:enhancement/use_shard_bulk_for_single_ops","ref":"enhancement/use_shard_bulk_for_single_ops","sha":"d51f414ea32b6e6ca63aa9c2250e750445b33d8c","user":{"login":"areek","id":753679,"avatar_url":"https://avatars.githubusercontent.com/u/753679?v=3","gravatar_id":"","url":"https://api.github.com/users/areek","html_url":"https://github.com/areek","followers_url":"https://api.github.com/users/areek/followers","following_url":"https://api.github.com/users/areek/following{/other_user}","gists_url":"https://api.github.com/users/areek/gists{/gist_id}","starred_url":"https://api.github.com/users/areek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/areek/subscriptions","organizations_url":"https://api.github.com/users/areek/orgs","repos_url":"https://api.github.com/users/areek/repos","events_url":"https://api.github.com/users/areek/events{/privacy}","received_events_url":"https://api.github.com/users/areek/received_events","type":"User","site_admin":false},"repo":{"id":16661385,"name":"elasticsearch","full_name":"areek/elasticsearch","owner":{"login":"areek","id":753679,"avatar_url":"https://avatars.githubusercontent.com/u/753679?v=3","gravatar_id":"","url":"https://api.github.com/users/areek","html_url":"https://github.com/areek","followers_url":"https://api.github.com/users/areek/followers","following_url":"https://api.github.com/users/areek/following{/other_user}","gists_url":"https://api.github.com/users/areek/gists{/gist_id}","starred_url":"https://api.github.com/users/areek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/areek/subscriptions","organizations_url":"https://api.github.com/users/areek/orgs","repos_url":"https://api.github.com/users/areek/repos","events_url":"https://api.github.com/users/areek/events{/privacy}","received_events_url":"https://api.github.com/users/areek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/areek/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/areek/elasticsearch","forks_url":"https://api.github.com/repos/areek/elasticsearch/forks","keys_url":"https://api.github.com/repos/areek/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/areek/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/areek/elasticsearch/teams","hooks_url":"https://api.github.com/repos/areek/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/areek/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/areek/elasticsearch/events","assignees_url":"https://api.github.com/repos/areek/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/areek/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/areek/elasticsearch/tags","blobs_url":"https://api.github.com/repos/areek/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/areek/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/areek/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/areek/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/areek/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/areek/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/areek/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/areek/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/areek/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/areek/elasticsearch/subscription","commits_url":"https://api.github.com/repos/areek/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/areek/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/areek/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/areek/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/areek/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/areek/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/areek/elasticsearch/merges","archive_url":"https://api.github.com/repos/areek/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/areek/elasticsearch/downloads","issues_url":"https://api.github.com/repos/areek/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/areek/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/areek/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/areek/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/areek/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/areek/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/areek/elasticsearch/deployments","created_at":"2014-02-09T06:24:53Z","updated_at":"2015-12-09T01:17:39Z","pushed_at":"2016-12-22T06:48:13Z","git_url":"git://github.com/areek/elasticsearch.git","ssh_url":"git@github.com:areek/elasticsearch.git","clone_url":"https://github.com/areek/elasticsearch.git","svn_url":"https://github.com/areek/elasticsearch","homepage":"http://elasticsearch.org","size":250025,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"8aca504c863d2351258e33e86b2c18e9365bbf99","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","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":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","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/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-12-22T10:35:43Z","pushed_at":"2016-12-22T08:34:34Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":299491,"stargazers_count":19923,"watchers_count":19923,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6848,"mirror_url":null,"open_issues_count":1186,"forks":6848,"open_issues":1186,"watchers":19923,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/21964"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/21964"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/21964/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/21964/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/d51f414ea32b6e6ca63aa9c2250e750445b33d8c"}}}}
{"actor":{"display_login":"martijnvg"}}