{"action":"created","comment":{"url":"https://api.github.com/repos/crate/crate/pulls/comments/28957077","id":28957077,"diff_hunk":"@@ -273,6 +302,64 @@ private void executeRequests() {\n         }\n     }\n \n+    private void createPendingIndices() {\n+        final List<PendingRequest> pendings = new ArrayList<>();\n+        final Set<String> indices;\n+\n+        synchronized (requestsForNewIndices) {\n+            indices = ImmutableSet.copyOf(Sets.difference(requestsForNewIndices.keySet(), indicesCreated));\n+            for (Map.Entry<String, List<PendingRequest>> entry : requestsForNewIndices.entrySet()) {\n+                pendings.addAll(entry.getValue());\n+            }\n+            requestsForNewIndices.clear();\n+            pendingNewIndexRequests.set(0);\n+        }\n+\n+        if (indices.size() > 0 && Iterables.any(indices, shouldAutocreateIndexPredicate)) {\n+            LOGGER.debug(\"create {} pending indices in bulk...\", indices.size());\n+\n+            final String[] indicesNames = indices.toArray(new String[indices.size()]);\n+\n+            BulkCreateIndicesRequest bulkCreateIndicesRequest = new BulkCreateIndicesRequest(indicesNames)","path":"sql/src/main/java/org/elasticsearch/action/bulk/SymbolBasedBulkShardProcessor.java","position":225,"original_position":225,"commit_id":"b56b07ffdc3bf22f56363c72d1bf7e560d5c0eeb","original_commit_id":"b56b07ffdc3bf22f56363c72d1bf7e560d5c0eeb","user":{"login":"mfussenegger","id":38700,"avatar_url":"https://avatars.githubusercontent.com/u/38700?v=3","gravatar_id":"","url":"https://api.github.com/users/mfussenegger","html_url":"https://github.com/mfussenegger","followers_url":"https://api.github.com/users/mfussenegger/followers","following_url":"https://api.github.com/users/mfussenegger/following{/other_user}","gists_url":"https://api.github.com/users/mfussenegger/gists{/gist_id}","starred_url":"https://api.github.com/users/mfussenegger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfussenegger/subscriptions","organizations_url":"https://api.github.com/users/mfussenegger/orgs","repos_url":"https://api.github.com/users/mfussenegger/repos","events_url":"https://api.github.com/users/mfussenegger/events{/privacy}","received_events_url":"https://api.github.com/users/mfussenegger/received_events","type":"User","site_admin":false},"body":"please change the of BulkCreateIndicesRequest to take a Collection... there are unnecessary array/collection transformations otherwise as you don't really use a string array inside anyway","created_at":"2015-04-23T12:22:52Z","updated_at":"2015-04-23T12:22:52Z","html_url":"https://github.com/crate/crate/pull/1921#discussion_r28957077","pull_request_url":"https://api.github.com/repos/crate/crate/pulls/1921","_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/comments/28957077"},"html":{"href":"https://github.com/crate/crate/pull/1921#discussion_r28957077"},"pull_request":{"href":"https://api.github.com/repos/crate/crate/pulls/1921"}}},"pull_request":{"url":"https://api.github.com/repos/crate/crate/pulls/1921","id":33866708,"html_url":"https://github.com/crate/crate/pull/1921","diff_url":"https://github.com/crate/crate/pull/1921.diff","patch_url":"https://github.com/crate/crate/pull/1921.patch","issue_url":"https://api.github.com/repos/crate/crate/issues/1921","number":1921,"state":"open","locked":false,"title":"prevent errors while creating too much partitions with one import","user":{"login":"mfelsche","id":1152667,"avatar_url":"https://avatars.githubusercontent.com/u/1152667?v=3","gravatar_id":"","url":"https://api.github.com/users/mfelsche","html_url":"https://github.com/mfelsche","followers_url":"https://api.github.com/users/mfelsche/followers","following_url":"https://api.github.com/users/mfelsche/following{/other_user}","gists_url":"https://api.github.com/users/mfelsche/gists{/gist_id}","starred_url":"https://api.github.com/users/mfelsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfelsche/subscriptions","organizations_url":"https://api.github.com/users/mfelsche/orgs","repos_url":"https://api.github.com/users/mfelsche/repos","events_url":"https://api.github.com/users/mfelsche/events{/privacy}","received_events_url":"https://api.github.com/users/mfelsche/received_events","type":"User","site_admin":false},"body":"be it bulk INSERT, INSERT from subquery or COPY FROM","created_at":"2015-04-22T14:58:04Z","updated_at":"2015-04-23T12:22:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d41bea7905f93deb2ce89fa87f09c08330fd2405","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crate/crate/pulls/1921/commits","review_comments_url":"https://api.github.com/repos/crate/crate/pulls/1921/comments","review_comment_url":"https://api.github.com/repos/crate/crate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crate/crate/issues/1921/comments","statuses_url":"https://api.github.com/repos/crate/crate/statuses/b56b07ffdc3bf22f56363c72d1bf7e560d5c0eeb","head":{"label":"crate:m/bulk_index_creation","ref":"m/bulk_index_creation","sha":"b56b07ffdc3bf22f56363c72d1bf7e560d5c0eeb","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"CRATE: Your Elastic Data Store","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","created_at":"2013-04-10T09:17:16Z","updated_at":"2015-04-23T12:18:45Z","pushed_at":"2015-04-23T12:18:47Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":101234,"stargazers_count":758,"watchers_count":758,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":37,"forks":77,"open_issues":37,"watchers":758,"default_branch":"master"}},"base":{"label":"crate:master","ref":"master","sha":"06933655e859d7267b115d0f7b1f13d0c0118e67","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"CRATE: Your Elastic Data Store","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","created_at":"2013-04-10T09:17:16Z","updated_at":"2015-04-23T12:18:45Z","pushed_at":"2015-04-23T12:18:47Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":101234,"stargazers_count":758,"watchers_count":758,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":37,"forks":77,"open_issues":37,"watchers":758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/1921"},"html":{"href":"https://github.com/crate/crate/pull/1921"},"issue":{"href":"https://api.github.com/repos/crate/crate/issues/1921"},"comments":{"href":"https://api.github.com/repos/crate/crate/issues/1921/comments"},"review_comments":{"href":"https://api.github.com/repos/crate/crate/pulls/1921/comments"},"review_comment":{"href":"https://api.github.com/repos/crate/crate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crate/crate/pulls/1921/commits"},"statuses":{"href":"https://api.github.com/repos/crate/crate/statuses/b56b07ffdc3bf22f56363c72d1bf7e560d5c0eeb"}}}}