{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/94099097","pull_request_review_id":14629384,"id":94099097,"diff_hunk":"@@ -1,36 +1,24 @@\n [[bulk-format]]\n [role=\"pagebreak-before\"]\n-==== Why the Funny Format?\n+==== 为什么是有趣的格式？\n \n-When we learned about bulk requests (((\"bulk API\", \"format of requests\")))earlier in <<bulk>>, you may have asked\n-yourself, ``Why does the `bulk` API require the funny format with the newline\n-characters, instead of just sending the requests wrapped in a JSON array, like\n-the `mget` API?''\n+当我们早些时候在<<bulk>>章节了解批量请求时，(((\"bulk API\", \"format of requests\")))您可能会问自己，\n+ ``为什么 `bulk` API 需要有换行符的有趣格式，而不是发送包装在 JSON 数组中的请求，例如 `mget` API？''。\n \n-To answer this, we need to explain a little background: Each document referenced in a bulk request may belong to a different primary\n-shard, each of which may be allocated to any of the nodes in the cluster. This\n-means that (((\"action, in bulk requests\")))every _action_ inside a `bulk` request needs to be forwarded to the\n-correct shard on the correct node.\n+为了回答这一点，我们需要解释一点背景：在批量请求中引用的每个文档可能属于不同的主分片，\n+每个文档可以被分配给集群中的任何节点。这意味着批量请求 `bulk` 中的(((\"action, in bulk requests\")))每个 _操作_ 都需要转发到正确的节点上的正确分片。\n \n-If the individual requests were wrapped up in a JSON array, that would mean\n-that we would need to do the following:\n+如果单个请求被包装在 JSON 数组中，那就意味着我们需要执行以下操作：\n \n- * Parse the JSON into an array (including the document data, which\n-   can be very large)\n- * Look at each request to determine which shard it should go to\n- * Create an array of requests for each shard\n- * Serialize these arrays into the internal transport format\n- * Send the requests to each shard\n+ * 将 JSON 解析为数组（包括文档数据，可以非常大）\n+ * 查看每个请求以确定应该去哪个分片\n+ * 为每个分片创建一个请求数组\n+ * 将这些数组序列化为内部传输格式\n+ * 将请求发送到每个分片\n \n-It would work, but would need a lot of RAM to hold copies of essentially\n-the same data, and would create many more data structures that the Java Virtual Machine (JVM) would have to spend time garbage collecting.\n+这是可行的，但需要大量的 RAM 来容纳本质相同的数据的副本，并将创建更多的数据结构，Java虚拟机（JVM）将不得不花费时间进行垃圾回收。\n \n-Instead, Elasticsearch reaches up into the networking buffer, where the raw\n-request has been received, and reads the data directly. It uses the newline\n-characters to identify and parse just the small +action/metadata+ lines in\n-order to decide which shard should handle each request.\n-\n-These raw requests are forwarded directly to the correct shard. There\n-is no redundant copying of data, no wasted data structures. The entire\n-request process is handled in the smallest amount of memory possible.\n+相反，Elasticsearch到达网络缓冲区，在那里原始数据已经被接收，并直接读取数据。\n+使用换行符字符来识别和解析小的 +action/metadata+ 行来决定哪个分片应该处理每个请求。\n \n+这些原始数据直接转发到正确的分片。没有冗余的数据复制，没有浪费的数据结构。整个请求尽可能在最小的内存中处理。","path":"040_Distributed_CRUD/35_Bulk_format.asciidoc","position":49,"original_position":51,"commit_id":"47957e06b80f9c812c59eda356d319b7205fbc53","original_commit_id":"47957e06b80f9c812c59eda356d319b7205fbc53","user":{"login":"node","id":227278,"avatar_url":"https://avatars.githubusercontent.com/u/227278?v=3","gravatar_id":"","url":"https://api.github.com/users/node","html_url":"https://github.com/node","followers_url":"https://api.github.com/users/node/followers","following_url":"https://api.github.com/users/node/following{/other_user}","gists_url":"https://api.github.com/users/node/gists{/gist_id}","starred_url":"https://api.github.com/users/node/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/node/subscriptions","organizations_url":"https://api.github.com/users/node/orgs","repos_url":"https://api.github.com/users/node/repos","events_url":"https://api.github.com/users/node/events{/privacy}","received_events_url":"https://api.github.com/users/node/received_events","type":"User","site_admin":false},"body":"这些原始请求会被直接转发到正确的分片。","created_at":"2016-12-29T03:33:48Z","updated_at":"2016-12-29T03:36:23Z","html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425#discussion_r94099097","pull_request_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/94099097"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425#discussion_r94099097"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425","id":98520677,"html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425","diff_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425.diff","patch_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425.patch","issue_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/425","number":425,"state":"open","locked":false,"title":"chapter4_part8:/040_Distributed_CRUD/35_Bulk_format.asciidoc","user":{"login":"AlixMu","id":19337684,"avatar_url":"https://avatars.githubusercontent.com/u/19337684?v=3","gravatar_id":"","url":"https://api.github.com/users/AlixMu","html_url":"https://github.com/AlixMu","followers_url":"https://api.github.com/users/AlixMu/followers","following_url":"https://api.github.com/users/AlixMu/following{/other_user}","gists_url":"https://api.github.com/users/AlixMu/gists{/gist_id}","starred_url":"https://api.github.com/users/AlixMu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlixMu/subscriptions","organizations_url":"https://api.github.com/users/AlixMu/orgs","repos_url":"https://api.github.com/users/AlixMu/repos","events_url":"https://api.github.com/users/AlixMu/events{/privacy}","received_events_url":"https://api.github.com/users/AlixMu/received_events","type":"User","site_admin":false},"body":"重新提交346\tmichealzh  的pr","created_at":"2016-12-19T07:52:47Z","updated_at":"2016-12-29T03:36:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be326fa98b7672e406edc394fa5358492c45bbb3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425/commits","review_comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425/comments","review_comment_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/425/comments","statuses_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/47957e06b80f9c812c59eda356d319b7205fbc53","head":{"label":"AlixMu:chapter/chapter4part8","ref":"chapter/chapter4part8","sha":"47957e06b80f9c812c59eda356d319b7205fbc53","user":{"login":"AlixMu","id":19337684,"avatar_url":"https://avatars.githubusercontent.com/u/19337684?v=3","gravatar_id":"","url":"https://api.github.com/users/AlixMu","html_url":"https://github.com/AlixMu","followers_url":"https://api.github.com/users/AlixMu/followers","following_url":"https://api.github.com/users/AlixMu/following{/other_user}","gists_url":"https://api.github.com/users/AlixMu/gists{/gist_id}","starred_url":"https://api.github.com/users/AlixMu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlixMu/subscriptions","organizations_url":"https://api.github.com/users/AlixMu/orgs","repos_url":"https://api.github.com/users/AlixMu/repos","events_url":"https://api.github.com/users/AlixMu/events{/privacy}","received_events_url":"https://api.github.com/users/AlixMu/received_events","type":"User","site_admin":false},"repo":{"id":72656618,"name":"elasticsearch-definitive-guide","full_name":"AlixMu/elasticsearch-definitive-guide","owner":{"login":"AlixMu","id":19337684,"avatar_url":"https://avatars.githubusercontent.com/u/19337684?v=3","gravatar_id":"","url":"https://api.github.com/users/AlixMu","html_url":"https://github.com/AlixMu","followers_url":"https://api.github.com/users/AlixMu/followers","following_url":"https://api.github.com/users/AlixMu/following{/other_user}","gists_url":"https://api.github.com/users/AlixMu/gists{/gist_id}","starred_url":"https://api.github.com/users/AlixMu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlixMu/subscriptions","organizations_url":"https://api.github.com/users/AlixMu/orgs","repos_url":"https://api.github.com/users/AlixMu/repos","events_url":"https://api.github.com/users/AlixMu/events{/privacy}","received_events_url":"https://api.github.com/users/AlixMu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlixMu/elasticsearch-definitive-guide","description":"欢迎加QQ群：109764489，贡献力量！","fork":true,"url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide","forks_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/forks","keys_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/teams","hooks_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/hooks","issue_events_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/issues/events{/number}","events_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/events","assignees_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/assignees{/user}","branches_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/branches{/branch}","tags_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/tags","blobs_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/languages","stargazers_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/stargazers","contributors_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/contributors","subscribers_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/subscribers","subscription_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/subscription","commits_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/contents/{+path}","compare_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/merges","archive_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/downloads","issues_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/issues{/number}","pulls_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/labels{/name}","releases_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/releases{/id}","deployments_url":"https://api.github.com/repos/AlixMu/elasticsearch-definitive-guide/deployments","created_at":"2016-11-02T16:01:23Z","updated_at":"2016-11-02T16:01:26Z","pushed_at":"2016-12-29T03:34:30Z","git_url":"git://github.com/AlixMu/elasticsearch-definitive-guide.git","ssh_url":"git@github.com:AlixMu/elasticsearch-definitive-guide.git","clone_url":"https://github.com/AlixMu/elasticsearch-definitive-guide.git","svn_url":"https://github.com/AlixMu/elasticsearch-definitive-guide","homepage":"","size":8704,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"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":"cn"}},"base":{"label":"elasticsearch-cn:cn","ref":"cn","sha":"5170412e995ade20a8830fcc2d2c7fa256faecc5","user":{"login":"elasticsearch-cn","id":2517572,"avatar_url":"https://avatars.githubusercontent.com/u/2517572?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch-cn","html_url":"https://github.com/elasticsearch-cn","followers_url":"https://api.github.com/users/elasticsearch-cn/followers","following_url":"https://api.github.com/users/elasticsearch-cn/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch-cn/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch-cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch-cn/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch-cn/orgs","repos_url":"https://api.github.com/users/elasticsearch-cn/repos","events_url":"https://api.github.com/users/elasticsearch-cn/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch-cn/received_events","type":"Organization","site_admin":false},"repo":{"id":20916742,"name":"elasticsearch-definitive-guide","full_name":"elasticsearch-cn/elasticsearch-definitive-guide","owner":{"login":"elasticsearch-cn","id":2517572,"avatar_url":"https://avatars.githubusercontent.com/u/2517572?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch-cn","html_url":"https://github.com/elasticsearch-cn","followers_url":"https://api.github.com/users/elasticsearch-cn/followers","following_url":"https://api.github.com/users/elasticsearch-cn/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch-cn/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch-cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch-cn/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch-cn/orgs","repos_url":"https://api.github.com/users/elasticsearch-cn/repos","events_url":"https://api.github.com/users/elasticsearch-cn/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch-cn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide","description":"欢迎加QQ群：109764489，贡献力量！","fork":true,"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide","forks_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/forks","keys_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/teams","hooks_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/events","assignees_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/tags","blobs_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/languages","stargazers_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/subscription","commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/merges","archive_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/downloads","issues_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/releases{/id}","deployments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/deployments","created_at":"2014-06-17T08:56:29Z","updated_at":"2016-12-29T02:35:21Z","pushed_at":"2016-12-29T03:34:32Z","git_url":"git://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git","ssh_url":"git@github.com:elasticsearch-cn/elasticsearch-definitive-guide.git","clone_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git","svn_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide","homepage":"","size":8710,"stargazers_count":96,"watchers_count":96,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":96,"mirror_url":null,"open_issues_count":46,"forks":96,"open_issues":46,"watchers":96,"default_branch":"cn"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/425"},"issue":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/425"},"comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/425/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/425/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/47957e06b80f9c812c59eda356d319b7205fbc53"}}}}
{"actor":{"display_login":"node"}}