GitHub PullRequestReviewCommentEvent at 2014-04-08 17:30:09
Repository: couchdb-fabric
Actor: chewbranca
Payload: {"comment":{"url":"https://api.github.com/repos/apache/couchdb-fabric/pulls/comments/11401289","id":11401289,"diff_hunk":"@@ -84,6 +74,30 @@ handle_message({rexi_EXIT, Reason}, Worker, State) ->\n         {error, Resp}\n     end;\n \n+%% HACK: this just sends meta once. Instead we should move the counter logic\n+%% from the #view_row handle_message below into this function and and pass the\n+%% meta call through maybe_send_row. This will also be more efficient doing it\n+%% here as it's one less worker round trip reply.\n+%% Prior to switching to couch_mrview, the fabric_view_reduce implementation\n+%% did not get a total_and_offset call, whereas now we do. We now use this\n+%% message as a clean way to indicate to couch_mrview_http:view_cb that the\n+%% reduce response is starting.\n+handle_message({meta, Meta}, {_Worker, From}, State) ->\n+    gen_server:reply(From, ok),\n+    #collector{\n+        callback = Callback,\n+        user_acc = AccIn\n+    } = State,\n+\n+    {Go, Acc} = case get(meta_sent) of\n+        undefined ->\n+            put(meta_sent, true),","path":"src/fabric_view_reduce.erl","position":66,"original_position":66,"commit_id":"aeac2dfe5014dc9fe1f10300669ea9244cae3a67","original_commit_id":"aeac2dfe5014dc9fe1f10300669ea9244cae3a67","user":{"login":"chewbranca","id":5326,"avatar_url":"https://avatars.githubusercontent.com/u/5326?","gravatar_id":"07a69dda92095f2bc69f5b6a3ce05e6e","url":"https://api.github.com/users/chewbranca","html_url":"https://github.com/chewbranca","followers_url":"https://api.github.com/users/chewbranca/followers","following_url":"https://api.github.com/users/chewbranca/following{/other_user}","gists_url":"https://api.github.com/users/chewbranca/gists{/gist_id}","starred_url":"https://api.github.com/users/chewbranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chewbranca/subscriptions","organizations_url":"https://api.github.com/users/chewbranca/orgs","repos_url":"https://api.github.com/users/chewbranca/repos","events_url":"https://api.github.com/users/chewbranca/events{/privacy}","received_events_url":"https://api.github.com/users/chewbranca/received_events","type":"User","site_admin":false},"body":"More details about this are in the commit message of aeac2df.\r\n\r\nBasically this is a temporary hack to keep of sending the metadata so that we only send it once. The previous fabric view reduce implementation did not have metadata rows, so this wasn't send along, whereas the new couch_mrview implementation does send them, and it's a very clean way to indicate a view reduce is starting. The update to stream this through `fabric_view:maybe_send_row` is complicated, and outside the scope of this initial work as I want to get some wider feedback on approach there.","created_at":"2014-04-08T17:30:09Z","updated_at":"2014-04-08T17:30:09Z","html_url":"https://github.com/apache/couchdb-fabric/pull/1#discussion_r11401289","pull_request_url":"https://api.github.com/repos/apache/couchdb-fabric/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/apache/couchdb-fabric/pulls/comments/11401289"},"html":{"href":"https://github.com/apache/couchdb-fabric/pull/1#discussion_r11401289"},"pull_request":{"href":"https://api.github.com/repos/apache/couchdb-fabric/pulls/1"}}}}